Sen. John McCain (R-Ariz.) has repeatedly come under attack from GOP nominee Donald Trump. Here are just a few of their rocky moments. (Peter Stevenson/The Washington Post)

Sen. John McCain (R-Ariz.) has repeatedly come under attack from GOP nominee Donald Trump. Here are just a few of their rocky moments. (Peter Stevenson/The Washington Post)

After 30 years in the Senate, during which he transformed himself from war hero into political icon, John McCain now finds himself in more jeopardy than at any time during his political career. And for much of that, he can blame Donald Trump.

This reelection campaign, his fifth, is forcing the Arizona Republican to do battle on multiple fronts, testing his political dexterity in ways unlike any of his previous races, including two unsuccessful bids for the presidency.

First he must clear his primary Tuesday, a day after he turns 80, against an arch-conservative whose campaign received a late six-figure boost from a Trump donor. Then, assuming he wins the nomination, he must move into a general election just two months away against a well-funded Democrat, U.S. Rep. Ann Kirkpatrick, whose campaign is wrapping McCain’s support for Trump around the veteran Republican’s neck in a bid to drive up Latino turnout.

McCain insists that he will not alter his high-wire campaign strategy, which basically involves steadfast support for Trump while also reserving the right to regularly criticize the GOP nominee when he does or says something objectionable.

But the personal and political antipathy between McCain and Trump has led some experts to suspect that McCain will dump Trump after he secures his party’s nomination Tuesday. The political calculus is that he desperately needs Trump’s voters to win the primary but needs Trump voters and anti-Trump independents to win the general election. McCain says he does not expect to stop supporting Trump before Election Day.

Republican presidential nominee Donald Trump said Sen. John McCain (R-Ariz.), a decorated Vietnam war veteran, was not a war hero because he was captured. (C-SPAN)

“I have no plans for that,” he said at his campaign headquarters, adding that his position on Trump is “pretty clear,” given how often he has challenged the Republican nominee. “My response to some of the things that Trump does, I don’t hesitate to speak up.”

McCain’s challenges extend beyond the Trump complications: He is running as a well-established figure with clout and experience in Washington in an era in which anti-establishment views are on the rise. He’s running as a plugged-in senator who will deliver for his state’s parochial interests, particularly on water issues, after years of burnishing his image as a maverick who chastised his Senate colleagues for using taxpayer dollars for political pork to win votes back home.

And he’s running as a staunch military hawk who wants an international force of 100,000 troops, led by 10,000 Americans, fighting Islamic State forces in Syria at a time when the public has grown weary of wars in the Middle East.

All of that comes with Trump at the top of the ticket, sometimes lashing out at McCain, sometimes tenuously embracing him, but almost always sucking up all the oxygen in the campaign. The first question the senator faced, after a 20-minute presentation to the local chamber of commerce in Scottsdale on Tuesday, was about Trump.

“I’m shocked,” the senator deadpanned, in the style of a late-night TV comedian.

[Trump refuses to endorse Paul D. Ryan, John McCain in their primary bids]

The questioner, Kurt Brueckner, 61, a Scottsdale lawyer, said he was deeply dismayed by Trump. His biggest fear was that Trump would sink other Republican candidates farther down the ballot, he said.

1 of 60 Full Screen Autoplay Close Skip Ad × What Donald Trump is doing on the campaign trail View Photos The GOP presidential nominee is out on the trail ahead of the general election in November. Caption The GOP presidential nominee is pressing his case ahead of Election Day. Nov. 7, 2016 Donald Trump speaks during a campaign event at SNHU Arena in Manchester, N.H. Jabin Botsford/The Washington Post Buy Photo Wait 1 second to continue.

The senator explained his position, saying he’d had the “most severe disagreement” with Trump when Trump attacked the parents of U.S. Army Capt. Humayun Khan, who was killed in Iraq in 2004, after Khan’s parents delivered a speech at the Democratic convention about their son and attacked Trump. But then McCain went on a rant about Hillary Clinton’s email scandal and her handling of the September 2012 attacks on two U.S. compounds in Benghazi, Libya.

He got himself out of the Trump question by segueing to a joke about corrupt Illinois politicians and prison food.

Brueckner said afterward that he is worried that McCain will lose his bid for a sixth term because of Trump. The lawyer said he would vote out of GOP loyalty for Trump but that other “lifelong Republicans” are planning to skip this election.

“I’ve got friends who say they are fed up with Trump and just aren’t going to vote,” Brueckner said. This is exactly the kind of sentiment that worries both the campaign and supporters despite recent polling that shows McCain comfortably ahead.

The most immediate embodiment of McCain’s problems is Kelli Ward, 47, a former state senator who knows that Trump crushed the field in the March presidential primary by stoking the fires of Arizona’s long-running battles over illegal immigrants crossing the southern border.

Ward is McCain’s main primary challenger Tuesday; she has attended Trump rallies and embraced his rhetoric while highlighting McCain’s bipartisan work on immigration bills that would grant undocumented immigrants a path to citizenship.

“He’s the champion of compromise,” she said of McCain in an hour-long interview in a Scottsdale campaign office, not intending it as a compliment.

Public and private polling give McCain a big lead over Ward, but this week’s CNN poll showed him with just 55 percent of the likely Republican primary vote. “We’re going to do well, not great, but we’re going to do well,” he told supporters at a rally.

That would leave McCain just nine weeks to try to gain the support of conservatives who opposed him in the primary while appealing to independent and moderate Democrats to try to hold off Kirkpatrick.

In a normal presidential year, the state’s conservative tilt helps Republicans, as it did for Sen. Jeff Flake (R-Ariz.), who won his 2012 race by three percentage points in part because of Mitt Romney’s victory here over President Obama by more than nine points.

Today, according to McCain’s pollster, Bill McInturff, “Trump and Clinton are essentially running even in Arizona.”

That is not the best news for McCain, but he remains the favorite even as the race is expected to be much closer than any of his previous reelections. For much of the summer, several polls had Kirkpatrick within single digits of McCain, but last week CNN released a poll showing McCain ahead 52 percent to 39 percent, above the crucial 50 percent threshold that pollsters closely watch for incumbent safety. The McCain camp is taking little comfort in the CNN poll, worried that it may not be fully capturing the current reality.

At a fundraiser in April, McCain said: “If Donald Trump is at the top of the ticket, here in Arizona, with over 30 percent of the vote being the Hispanic vote, no doubt that this may be the race of my life.” Politico first reported the remarks, in which McCain continued: “If you listen or watch Hispanic media in the state and in the country, you will see that it is all anti-Trump. The Hispanic community is roused and angry in a way that I’ve never seen in 30 years.”

McCain’s closest friends lament his predicament. Trump dismissed McCain’s war record in July 2015, saying getting shot down and captured in Vietnam does not make McCain a hero in Trump’s eyes: “He is a war hero because he was captured,” Trump said at a rally in Iowa. “I like people who weren’t captured, okay.” And this month, Trump told The Washington Post that he “always had a difficult time with John” because McCain did not “do enough” on veterans issues.

Yet McCain grits his teeth and professes support for Trump, but mostly by talking about how Clinton would shift the Supreme Court to liberals — or he uses prison jokes to move on to other topics.

Many of those anti-McCain voters in Tuesday’s primary also supported Trump in March, so any post-primary pivot by McCain to trash Trump risks alienating more voters among conservatives than he might gain among moderates.

“I’ve heard all those arguments,” Flake, the leading Trump critic in the Senate, said in an interview. “I don’t know where it all comes down.”

Flake said that McCain’s 2008 role as presidential nominee, in a race where he lost badly, makes him more reluctant to abandon Trump.

“I admire him, whatever he does,” Flake said.

Then there’s Kirkpatrick, the Democrat once considered a long shot who has amassed a strong war chest. She has an important ally in One Arizona, a coalition of Hispanic groups hoping to register at least 75,000 new Latino voters for November.

Kirkpatrick isn’t just using Trump’s language about Mexican “rapists” — 90 percent of Arizona’s Hispanics are of Mexican heritage — but her campaign is also using McCain’s past against him, particularly his support for building “the danged fence” during his 2010 Republican primary. She aired video of McCain supporting a wall or fence on Spanish-language TV during the Copa America soccer tournament.

“He’s been back and forth on that issue,” said Kirkpatrick, who is going after McCain from the left on immigration as Ward goes at him from the right.

In an interview, Kirkpatrick said she entered the race a year ago because her polling and focus groups showed that voters viewed McCain differently. Gone was the “maverick” who took on his party leaders and who fought to change the campaign finance system.

They consider him an insider who is benefiting handsomely from a super PAC stockpiled with more than $2 million, half of it from seven mega-donors writing six-figure checks.

“What I hear the most often from people is, ‘John McCain has changed,’ ” Kirkpatrick said.

McCain rejects that criticism but said he thinks that politics has changed around him, becoming meaner, nastier, less civil. He mocked conservatives who are angry at him for rebuking a voter in 2008 who told McCain that Obama was a Muslim.

“People are stunned that I said to the woman: ‘No, Barack Obama is an honorable man.’ That was sort of the standard way you’d conduct yourself,” he said, making a mock gasp over his demeanor. He pointed to Ward’s attacks on his age and her questioning whether he could live through a full, six-year term.

“The whole tenor and dialogue in elections is just taking a dive to the bottom,” he said.

Friends such as Flake think Trump is the one leading that dive, but McCain won’t abandon the nominee, even after Trump attacked a Gold Star family.

“You just can’t do that,” McCain told the Scottsdale business executives. “Some things transcend anything to do with politics.”

Yet seconds before, he had summed up his Trump support in purely political terms: “All I can say is, I said I would support the nominee of the party. I continue to support the nominee.”