President Donald Trump’s endorsement of Mitt Romney’s U.S. Senate campaign in Utah may have come as a surprise to some given their complicated history.

Trump and Romney have had a roller-coaster relationship for years, often throwing insults at each other in times of distress — and exchanging pleasantries when mutually beneficial.

Romney, the 2012 Republican presidential nominee who is now running to replace retiring Utah Republican Sen. Orrin Hatch, famously called Trump a “phony” and a “fraud” during Trump’s presidential campaign. Trump has repeatedly slammed Romney, the former Massachusetts governor, for his failed 2012 campaign, despite endorsing Romney that year.

Still, Trump considered Romney as a possible Secretary of State before choosing Rex Tillerson, and now Trump has endorsed Romney’s political comeback.

Here’s a history of Trump and Romney’s rocky relationship.

February 2012: Trump endorses Romney

Republican presidential candidate, former Massachusetts Gov. Mitt Romney (L) and Donald Trump shake hands during a news conference held by Trump to endorse Romney for president at the Trump International Hotel & Tower Las Vegas February 2, 2012 in Las Vegas, Nevada.

Ethan Miller—Getty Images

Trump endorsed then-GOP presidential candidate Romney’s campaign back in February 2012. “Mitt is tough, he’s sharp, he’s smart,” Trump said at the time.

“Donald Trump has shown an extraordinary ability to understand how the economy works,” Romney said, adding, “it means a great deal to me to have the endorsement of Mr. Trump.”

October and November 2012: Trump boosts Romney on Twitter

As the 2012 presidential election approached, Trump took to Twitter, calling on Americans to vote for Romney, posting videos and quotes from the candidate and lauding his performance in debates against former President Barack Obama.

November 7, 2012: Trump says Romney blew the election

After Romney’s loss to Obama, Trump tweeted that Romney “is a good man but he just never connected with the people.”

October 2014: Trump says Romney shouldn’t run again

Amid rumors that Romney would run for president again in 2016, Trump tweeted that Romney “had his chance and blew it.”

July 2015: Romney criticizes Trump’s campaign launch

After Trump announced he would run for president, Romney criticized Trump’s remarks on Mexico and undocumented immigrants — saying that the comments hurt the Republican Party.

“I think he made a severe error in saying what he did about Mexican-Americans,” Romney said, according to CNN.

Days later, Romney then slammed Trump for going after Arizona Republican Sen. John McCain’s military record.

Trump responded by pointing to Romney’s loss to Obama in 2012.

September 30, 2015: Romney says Trump won’t win

In a speech at Georgetown University, Romney said he “would have never predicted” that Trump would be leading his party, according to the Washington Post. He also predicted Trump would not become the Republican presidential nominee.

He added that while he found Trump’s popularity to be a positive for the party, his rhetoric was a negative.

“The negative side is that he’s said some things that he described the other day as being ‘childish,’” Romney said. “I’m afraid he brought attention to [immigration] in a way that was not productive and not appropriate in saying the…