“Just being Latino in the state gave us a lot of anxiety,” said Ms. Maldonado, 29. “You’d say goodbye to your parents in the morning and not know if they would be caught up in a raid.” As Arizona now stands to become a coveted prize for Democrats, Maricopa County is undergoing what may amount to one of the biggest political shifts of any major county in the United States in recent years. The last time Maricopa County came this close to siding with a Democratic presidential candidate was in 1948.“We think of John Wayne and the Sonoran Desert when we have visions of Arizona, but the truth is we’re an urban state where the Phoenix metro area is the heart and soul of Arizona at this point,” said Joseph Garcia, executive director of Chicanos Por La Causa Action Fund, a Phoenix group that helped register and turn out thousands of Latino voters for Joseph R. Biden Jr. Accounting for about 60 percent of Arizona’s population with nearly 4.5 million people, Maricopa County ranks among the fastest-growing counties in the United States. The influx of more voters from other states, many of them relatively moderate or liberal, has produced some of this growth.But the county has also provided one of the most important venues for the ascendancy of Latino voters and elected officials in recent years, following the rapid growth of its Latino population since the start of the century, from about 365,000 in 2000 to more than 1.3 million in 2020.While Latinos in Florida got much of the nation’s attention this week for helping Mr. Trump win that state, efforts to boost voting for Democrats by Arizona’s Latinos got relatively little notice — and negligible help from the national Democratic Party, Mr. Garcia said.“All the attention for whatever reason goes to Miami-Dade County as if that is the center of the universe for Latinos,” he said. Referring to the national party, he added, “We didn’t get any help from them, but for us the Latino vote was too important and we weren’t going to wait around.” There is now a considerable list of elected positions in the county that are held by Democrats, including county recorder, sheriff, assessor and school superintendent — all in the place where the five-term Republican senator Barry Goldwater led the resurgence of the American conservative movement in the 1960s and ’70s.- Advertisement – PHOENIX — Ten years ago, Maricopa County was the place that spawned the political careers of Republican hard-liners like Joe Arpaio, the sheriff who demonized immigrants and placed inmates in a tent camp. Politicians from Phoenix and its suburbs thrived with appeals to voters on guns, religion and taxes.But these days, the county’s scorching growth has produced a battleground in which Republicans suddenly find themselves on the defensive. The children of the immigrants targeted by Mr. Arpaio, as well as an influx of outsiders from places like California, are reshaping the political landscape of this part of the West.- Advertisement – Many Democrats trace the changes that made them competitive in Maricopa County to the spate of anti-immigrant laws a decade ago that helped galvanize Latino youth in Arizona. A decade later, they have given rise to a generation of activists and elected officials.Raquel Terán, a Democratic state legislator who represents a district that encompasses parts of Phoenix and Glendale, began her political career as a field organizer fighting against anti-immigrant legislation and for workers’ rights.In 2012, she ran for office and lost by just 113 votes before resuming work as an organizer. Eventually, she became the state director for Mi Familia Vota, a national group that helps Latinos become citizens and register to vote. She decided to enter the race again in 2018, and won. This year she ran unopposed for a second term. Updated Nov. 6, 2020, 9:01 p.m. ET “We were helping people focus on our struggles, access to education, health care and jobs,” said Eduardo Sainz, state director of Mi Familia Vota.In addition to swinging the state in the presidential race, the effort led to the passage of a proposition on this year’s ballot to bolster funding for public schools by hundreds of millions of dollars each year by imposing a tax on the top 4 percent of wage earners in Arizona.Simon Romero reported from Phoenix, Miriam Jordan from Los Angeles and Michael Wines from Washington. Frances Robles contributed reporting from Miami. The shift from the old days seems jarring even to some of the Democrats involved in making it happen.Adrian Fontes, a former trial lawyer and Marine, became the first Latino elected to countywide office in Maricopa County in 2016.“I never thought I would get elected, period,” said Mr. Fontes, who now oversees elections as the county recorder after defeating a Republican incumbent who had held the seat since 1988. “I did not anticipate because of my lack of political savvy that Maricopa County would be the most important county in the most important presidential race in recent history,” he said in a recent interview.As votes in the county are counted this week, pro-Trump protesters, some of them armed with military-style rifles, have unsuccessfully demanded to be allowed in the building where the tabulation is taking place. The crowds have at times been chanting for Mr. Fontes to be recalled.Since he is also running for re-election, Mr. Fontes is staying away from both the tabulation center and his own recorder’s complex to avoid the appearance of any impropriety during the vote count. He is leading his Republican opponent in the race. Instead of leaving the state, she said, many young Latinos were energized. “It turned into a moment for folks to stand up, fight back and move past the fear to do something about it,” she said.A decade later, Ms. Maldonado, the daughter of a janitor and a teacher’s aide who immigrated to Phoenix from Mexico, is among the many children of immigrants who have built a grass-roots movement that has educated and mobilized hundreds of thousands of Latino voters.Ms. Maldonado began working with activists who mobilized in response to the anti-immigrant law.Hundreds of volunteers worked during the recent election campaign, braving 110-degree heat in face shields to engage Latinos in a “Basta Trump” (“Enough of Trump”) campaign. Others made phone calls and sent texts. “It’s the deliciousness of irony that not one of these people voted for me and we all want the exact same thing from this election: We want every valid vote counted,” he said of the protests. Various factors have contributed to the political reconfiguration, originating with the backlash — including from powerful Republicans in the Phoenix business establishment — against Arizona’s immigration crackdown in 2010. The changes began to take shape clearly by 2016, when Mr. Arpaio was defeated and Hillary Clinton lost the county by just three percentage points. “Through the years, we have been building political power,” Ms. Terán said. “And 2020 shows our work is paying off.”Another activist, Anabel Maldonado, was in high school when Arizona enacted legislation in 2010 that empowered the police to stop and question anyone they suspected of being in the country illegally, targeting undocumented immigrants in a state that had become a laboratory for such measures.Mr. Arpaio, the former sheriff, enforced the law, known as SB1070, by deploying his deputies across Maricopa County to conduct arrests and workplace raids. – Advertisement – “Right now, Maricopa is tangibly, unabashedly, demonstrably a Democratic county, something I never thought I would see in my lifetime,” said Stan Barnes, 59, a longtime Republican strategist in Phoenix. “It just blows my mind.”Even as Maricopa County’s individualistic gunslinging reputation is giving way to calls for change from its increasingly diverse electorate, it remains — like much of the country — sharply divided along political fault lines. The county’s Republicans maintain immense sway in Arizona’s state politics. Some of Mr. Trump’s most fervent supporters live in Maricopa County, reflected in the armed protesters who have been positioning themselves this week in front of the County Recorder’s voting tabulation site. – Advertisement – They accelerated in 2018 with Kyrsten Sinema’s flip of a Senate seat into Democratic hands. And they turned into a potential game-changer this week, as the county appeared to be providing a crucial boost to Mr. Biden’s bid for the presidency and Mark Kelly’s flip of yet another Senate seat held by Republicans.Vice President Joseph R. Biden Jr. led President Trump by about three percentage points in Maricopa County as of Friday afternoon — in a county that in 2012 saw Mitt Romney, then the Republican nominee for president, carry Maricopa County by 12 percentage points.