It was a day in early April when Barack Obama received an unexpected call from McCain, who was battling brain cancer and said he had a blunt question to ask: Would you deliver one of the eulogies at my funeral?
Obama, who is responsible for extinguishing McCain's second bid for the White House a decade ago, immediately answered that he would. He was taken aback by the request, aides say, as was George W. Bush, another former rival, who received a similar call from McCain this spring.
When the 43rd and 44th US presidents stand on the high altar of the soaring cathedral on Saturday, after the "Battle Hymn of the Republic" anthem is played, they will not only be celebrating the life of John Sidney McCain III. It will be McCain, too, having a not-so-subtle last word, aimed at another president he made clear he did not want to attend: Donald J. Trump.
While neither of the two former presidents were especially close to McCain in life, he and Bush were fellow Republicans, forged together for better or worse, through policy and party loyalty. After a deeply personal and vitriolic primary fight in 2000, McCain went on to endorse Bush and occasionally campaigned with him four years later.
But McCain's decision to invite Obama to speak at his funeral stands out as far more extraordinary, given their brutal and bitter rivalry during the 2008 presidential race.
McCain viewed Obama as naïve and unprepared for the presidency. To be clear, those critiques lingered long after Obama won, particularly on matters of national security.
Their relationship isn't intimate at all, but rather one rooted in mutual respect and a shared sense of alarm at today's caustic political climate. Their telephone call on that April day was first arranged by advisers, not McCain simply dialing up Obama as he would do with his legion of friends, a sign they were hardly tight.
In fact, the two have spoken by phone only a couple of times since Obama left the White House, aides to both men say, most notably last summer when Obama reached out after McCain cast the deciding vote to salvage the Affordable Care Act. He thanked him. The call was brief.
Obama has not been among the long parade of visitors who came to see McCain on his Arizona ranch as he fought brain cancer. George and Laura Bush dropped by not long ago, as did former Vice President Joe Biden, a close and longtime friend of McCain's in the Senate, who will deliver a eulogy at a memorial service on Thursday in Arizona.
But McCain's decision to ask Obama and Bush to eulogize him is part of a carefully choreographed -- and, yes, even strategic -- message for America and the world in the wake of his death. It's also perhaps, one last opportunity for McCain to try and tamp down a fervor that first awoke in the Republican Party during his 2008 race and has swelled ever since.
'A lesson in civility'
Steve Duprey, a longtime friend of McCain's and a senior adviser in his 2008 campaign, said the senator respected Obama, even if the two were never particularly close and wounds from their race were raw for years.
"I think it is John McCain imparting a lesson in civility by asking the two men who defeated him to speak, as an example to America that differences in political views and contests shouldn't be so important that we lose our common bonds and the civility that is, or used to be, a hallmark of American democracy," Duprey said.
David Axelrod, a senior adviser to Obama in his campaigns and in the White House, said the clear message McCain is sending is "about our shared heritage, our shared trust of this democracy that transcends party and transcends tribe."
"It really does animate his message of national unity," Axelrod said. "There is a kind of poetry to it that he wanted his two erstwhile opponents to eulogize them."
Even unspoken, the lesson also shines a light on McCain's outward disdain for Trump and his presidency. And McCain hardly shied away from that in a farewell, posthumous message released on Monday in which he echoed his concession speech to Obama from a decade ago.
"Do not despair of our present difficulties but believe always in the promise and greatness of America, because nothing is inevitable here," McCain wrote in the statement released after his death. "Americans never quit. We never surrender. We never hide from history. We make history."
But as the remarkable story of McCain's life has been replaying this week -- his acts of wartime heroism and his admissions of congressional mistakes -- it's striking the degree to which the old quarrels seem almost charming in the era of Trump.
Burying the hatchet
Not mincing words, as McCain rarely did, one of his friends explained it like this: Trump has made it far easier for McCain to bury the hatchet with Bush and Obama.
It was Obama, in particular, who got under McCain's skin long before they faced off in the general election of the 2008 campaign. Their first skirmish happened two years earlier in the halls of the Senate, where McCain blasted Obama for "posturing" on one of his favorite issues: lobbying reform.
"I understand how important the opportunity to lead your party's effort to exploit this issue must seem to a freshman senator, and I hold no hard feelings over your earlier disingenuousness," McCain wrote in a searing and sarcastic letter to Obama .
Those early dust-ups, of course, grew into full-blown fights on the campaign trail, when McCain aired his long-held observation that Obama was full of himself.
"I don't seek the presidency on the presumption that I am blessed with such personal greatness," McCain said one day in the early stages of their race . "That history has anointed me to save my country in its hour of need."
What annoyed McCain the most, of course, was how Obama was steadily capturing the mantle of change and the air of excitement that he once enjoyed aboard his famous campaign bus, the Straight Talk Express.