At the same time, the issues animating debate in the Trump era — immigration, race and identity — have long riled Arizona conservatives, who tend to demand a hard line from their politicians. Indeed, long before Mr. Trump electrified Republican audiences by proposing a border wall financed by Mexico, Senator John McCain overcame a 2010 primary challenge with a vow to “complete the danged fence.”
“It feels like the rest of the country is waking up to what we’ve been experiencing over the last dozen years or so,” said January Contreras, a Democratic candidate for state attorney general who is vying to be Arizona’s first Latina elected statewide.
With Mr. Flake retiring and Senator John McCain undergoing treatment for brain cancer, Republicans could be defending two Arizona Senate seats, enough to determine the majority in a chamber where they have just a single-seat advantage. A race between Ms. McSally and Representative Kyrsten Sinema, a well-funded Democrat who has the blessing of her national party, may be the marquee open-seat Senate election in the country.
And there may be as many as three competitive House races across a mix of rural and urban terrain here that reflect the types of districts that Democrats will need to keep and pick up if they are to reclaim the House.
Far from the caricature of being a sleepy, cactus-filled preserve of Midwestern snowbirds with a penchant for golf and dry heat, this booming and increasingly diverse state spotlights the opportunities and pitfalls both parties are grappling with nationally. As Republicans veer between a hard-line primary electorate and a very different one that will show up in November, Democrats have to hold down their losses in the rural areas and win over suburban centrists — who routinely supported Mr. McCain and a procession of Republican presidential nominees. That means offering some measure of support for immigration restrictions without depressing the state’s Latinos.
The roiling dispute over the border and illegal immigration in Arizona, is largely why Mr. Trump won here by less than four percentage points in 2016 and the hard-line county sheriff Joe Arpaio was ousted from his post the same year. A coalition of Hispanics and some right-leaning whites, including many of the state’s Mormons, proved deeply uncomfortable with the incendiary language and scapegoating that is a rhetorical hallmark of both men.
And that split seems baked in to the demography of Arizona, which has the widest so-called racial generation gap of any state in the country: Just 19 percent of the population over 65 is nonwhite; 60 percent of those under 18 are nonwhite.
Those numbers — and the tension between the demands of Republican primary voters and those of the wider electorate — will eventually prove their party’s undoing, some Republicans worry. There is a sharp divide between native-born white Arizonans, who grew up around Hispanics and hearing Spanish, and transplants to the Southwest from more heavily white states.
“The Arizona Republican Party, they’re just slitting their own throats,” said John Giles, the Republican mayor of Mesa, which has a larger population than St. Louis. “They are pushing and doing everything they can to offend the Latino population.”
Mr. Flake, like Mr. Giles, is a native-born Arizonan, and he shares the same alarm about both immigration and embracing Mr. Trump. He is worried that Ms. McSally is going overboard.
“I’d be a lot more careful now in how much you cozy up,” Mr. Flake said of his would-be successor, adding: “There’s a balance she’s got to strike. I cringe a little — I think a lot of people do.”
Mr. Flake said he had encouraged Ms. McSally to be more careful. But in a sign of how toxic the senator has become with Arizona Republicans since he wrote a blistering book denouncing Mr. Trump, Ms. McSally said she did not recall having any such conversation.
“I’m not seeking his political advice,” she curtly added.
The degree to which Mr. Flake and Mr. McCain have become pariahs among conservative activists was on display during a weekend of state party dinners and organizing events in which Gov. Doug Ducey avoided even mentioning their names. One party regular who showed up in Revolutionary War garb and offered only his first name, articulated the challenge for Trump-skeptic Republicans.
“They don’t support Trump, that’s it, 100 percent,” said Arthur, a transplant to Scottsdale, explaining his disdain for his senators. As for immigration, he had a blunt message for would-be migrants: “Fix your country. Don’t come here and mess up mine”
So for now, Ms. McSally, who enjoys the quiet support of the state and national party establishment, is working to bolster her relationship with Mr. Trump.
Her primary race at the moment features two immigration hard-liners: Mr. Arpaio, who says he wants to deport children brought to the country illegally before letting them apply for legal status, and a former state senator, Kelli Ward, who garnered just under 40 percent of voters in a 2016 primary election against Mr. McCain.
Ms. McSally is likely to benefit from the party’s right wing being divided. But should the McCain seat come open, or should Mr. Arpaio, 85, not go through with his bid, she may face a more daunting one-on-one race with one of the anti-establishment candidates, both of whom sound Trumpian notes.
The president pardoned Mr. Arpaio last year for criminal contempt, and Ms. Ward said in an interview that she met with the president in December and discussed the race. (She cornered him at his Mar-a-Lago estate in Florida during the holidays, according to one Republican familiar with the encounter.)
Ms. McSally has been helped by an aggressive backstage effort from Republican officials in and out of the White House to keep the president from backing Mr. Arpaio or Ms. Ward. Before she entered the race, Ms. McSally won assurances from an intermediary that Mr. Trump would not endorse her rivals, according to a Republican directly familiar with the conversation, and she and her advisers met last week in the White House with the president’s political team, an opportunity not afforded the other candidates.
To further inoculate herself from the right, Ms. McSally is declining to say whether she would support a comprehensive measure that offers legal status to undocumented immigrants and is publicly showering Mr. Trump with praise, though she will not reveal whom she voted for in 2016 or any election.
Is he a good man? “I think he has done a lot of amazing things in his life,” she said
Is he a role model? “I think he is, yeah. I mean, look, everybody has got their strengths and weaknesses,” she offered.
And about that report that Mr. Trump had an affair with a porn star shortly after his wife gave birth and later paid her more than $100,000 to stay quiet? “Alleged this and alleged that,” she replied.
Ms. McSally also said “sure, absolutely” she would campaign with Mr. Trump in the general election, a step Mr. Flake said offered far more risk than reward.
“You create ads that will be run,” he said. “And particularly if there happens to be two senatorial elections, you’re going see just a wave of money.”
Yet Ms. Sinema, who began her career in politics as a Ralph Nader supporter and has become a member of the centrist Blue Dog coalition, is stepping gingerly around Mr. Trump in ways that may irritate the left.
In a brief phone interview, she declined to offer even the most gentle of criticism of a president who many in her party believe is a threat to American democracy.
Ms. Sinema noted that she and Mr. Trump “worked together very well” on veterans’ issues and sidestepped questions about his character.
“I mean, I’m happy to work with anyone at any time,” she said with a nervous laugh. “I don’t spend my time worrying about, you know, personality stuff. That’s not my issue.”
As for her own politics, Ms. Sinema would not say whether she was a progressive or a moderate. “I would say I’m an Arizonan,” she said.
It is a risk-averse approach that her allies believe could pay dividends in a state that still leans Republican, should Democrats enjoy a wave election year.
But to some Arizona liberals, Ms. Sinema’s pragmatism is bitterly disappointing.
“We already know that we can’t trust her,” said Tomas Robles, who led protests at Ms. Sinema’s office to push her to stand up for the so-called Dreamers, young undocumented immigrants brought to the country as children.
The perennial challenge for Democrats here is that Hispanics do not vote anywhere near to the level of their population.
Mr. Robles said his and other groups intended to register 200,000 new voters this year.
“She’s going to have to really work to earn those votes,” he said. “If you’re alienating the largest minority group in Arizona, you’re going to have a tough time winning an election as a Democrat.”