Ms. Kirkpatrick said that being anti-Trump “is a strong message,” but she acknowledged that “it’s not the only message.” She recently opened a field office in Tempe, and has many Arizona State University volunteers working the phones. Working out of an old bank, aides sit in the former vault (the door has been removed) to go over Mr. McCain’s statements, year by year, and look for inconsistencies that suggest too long a stay in Congress.

“The race comes down to whether Arizonans take a step back and judge John McCain for being John McCain and his remarkable life of public service,” said Grant Woods, a former state attorney general and the senator’s friend for decades. “And not as being a long-term incumbent, and not as a Republican in a year when the party has a controversial nominee. If they do that, he will win walking away. If they don’t, then it could be tight. Could he lose? Yeah.”

Despite the personal attacks by Mr. Trump on the senator’s integrity and war record, Mr. McCain cannot afford to reject Mr. Trump and alienate his many supporters in Arizona if he hopes to hold his seat, an agonizing trade-off. Mr. McCain is the embodiment of much that voters in both parties, but especially fans of Mr. Trump, have said they would like to jettison this year. He is the ultimate establishment player, having served in Congress for nearly four decades — five terms in the Senate alone.

“Back in the Middle Ages, I was known as the maverick,” Mr. McCain said, smiling wanly.

He is an unapologetic free trader, an interventionist abroad who continues to defend the deeply unpopular war in Iraq, a supporter of private industry and markets, and the original, if inconstant, champion of changes to the immigration system that would help some illegal immigrants become citizens.

To succeed in what most people believe will be his last political campaign, Mr. McCain must canter around the state assuring Mr. Trump’s detractors that he does not share the businessman’s visions for mass deportation and the dissolution of NATO, while continuing to woo an angry Republican base that overwhelmingly voted for Mr. Trump in the state’s March primary.

“I’ve been feeling it out there for some time,” Mr. McCain said. “In the southern part of the state here, they are not feeling the recovery at all. Then there is this whole issue with these young people and kids carrying around all this debt.”