President Donald Trump tweeted his condolences to the family of Arizona Republican Sen. John McCain on Saturday night, just over an hour after the revered prisoner of war and longtime elected official died.

“My deepest sympathies and respect go out to the family of Senator John McCain. Our hearts and prayers are with you!” Trump wrote, a line that stood in stark contrast to the relationship the pair had while McCain lived.

My deepest sympathies and respect go out to the family of Senator John McCain. Our hearts and prayers are with you! — Donald J. Trump (@realDonaldTrump) August 26, 2018

Trump feuded relentlessly with McCain, a former presidential nominee who insisted on decency and dignity in politics and repeatedly spoke out against Trump's rhetoric and actions.

Early in Trump’s presidential campaign, which he launched by declaring some Mexican immigrants "rapists," the Arizona Republican made clear his distaste for the then-candidate. He said in June 2015 that he did not agree “with his comments about the quote, Mexicans."

When Trump rallied a large crowd in Arizona, he called McCain “incompetent” and “very weak on immigration.” In July 2015, McCain said Trump had “fired up the crazies” in Arizona.

Trump immediately called on McCain to apologize. Two days later, the candidate — who has long said he always punches back harder than his critics — fired off a line that left many speechless.

"He's not a war hero. He's a war hero because he was captured. I like people that weren't captured,” Trump said at a campaign event in Iowa. Pundits thought the remark went too far and predicted that Trump's bid for the White House was sunk.

Trump’s campaign continued nonetheless — he won the Republican nomination, and then the White House. But the pair sparred until the very end.

McCain criticized Trump over controversial remarks he made about Muslims, Gold Star families, torture, relations with Russia, foreign policy, and more, while Trump tweeted some 40 times about McCain during his presidential bid, calling McCain a “dummy” and saying he did a “lousy” job on behalf of American veterans.

Embroiled in a Republican primary through the fall of 2016, McCain maintained his support for Trump as the party’s nominee. After initially suggesting he wouldn’t endorse McCain, Trump endorsed the Republican in the Arizona Senate race in August 2016.

The détente lasted just a couple months.

In October of 2016, McCain withdrew his support for the candidate after a 2005 recording was released, where Trump can be heard boasting about grabbing and kissing women without their consent.

“It’s not pleasant for me to renounce the nominee of our party. He won the nomination fair and square. But this is — I have daughters. I have friends. I have so many wonderful people on my staff. They cannot be degraded and demeaned in that fashion,” McCain said at the time.

Trump and his allies dismissed his words as “locker-room talk,” and Trump sought to portray McCain as a hypocrite who had previously begged for Trump’s endorsement in a previous race.

The very foul mouthed Sen. John McCain begged for my support during his primary (I gave, he won), then dropped me over locker room remarks! — Donald J. Trump (@realDonaldTrump) October 11, 2016

After Trump took office, the pair’s relationship worsened.

After Trump ordered a travel ban on people from certain Muslim-majority nations, McCain and fellow Republican Sen. Lindsey Graham said the order "will become a self-inflicted wound in the fight against terrorism."

Trump swung back and forth from barbs to plaudits on McCain during the Obamacare votes last year, applauding McCain for returning to Washington for an Obamacare vote while battling brain cancer last summer, and then condemning him for voting against an Obamacare repeal.

Democrats are laughingly saying that McCain had a "moment of courage." Tell that to the people of Arizona who were deceived. 116% increase! — Donald J. Trump (@realDonaldTrump) September 23, 2017

In August 2017, McCain penned a fiery op-ed that condemned Trump as “a president who has no experience of public office” and “is often poorly informed and can be impulsive in his speech and conduct.”

This summer, the feud seemed to climax.

At a June rally, Trump complained about McCain without once mentioning his name.

"[H]e campaigned on repealing and replace, we had all the votes, and perhaps he was grandstanding, who knows what he was doing? But you know what? He said, ‘No, no.’ Everybody said, ‘What the hell happened?’ He’s been campaigning for eight years — repeal and replace. And he didn’t do that," he said in South Carolina.

In July, after Trump met with Russian President Vladimir Putin, McCain said it was "one of the most disgraceful performances by an American president in memory." He said Trump had "abased himself" before a "tyrant."

In McCain's final weeks of life, Trump responded with pointed silence.

In August 2018, Trump visited Fort Drum in upstate New York to sign the John S. McCain National Defense Authorization Act for Fiscal Year 2019 — this year's version of an annual bill that sets defense policy, named to honor the dying senator. Trump chose not to mention him, going so far as to omit McCain's name when citing the title of the bill.

After the news broke that McCain would stop medical treatment and Washington began to mourn the senator whose death appeared imminent with an outpouring of bipartisan support, Trump again stayed silent during remarks at a fundraising dinner for the Ohio Republican Party in Columbus Friday night.

Trump did, however, mention Kanye West and Kim Kardashian West.