Rudy Giuliani endorsed Mitt Romney Monday morning, saying the all-but-official GOP nominee “has proved, time and again, that he excels at turning around difficult situations.”

In an interview with Fox News on the day before New York’s primary, Giuliani added, “who better than Mitt Romney to carry our banner” against President Obama? He praised the former Massachusetts' governor’s understanding of economics and “strength and toughness” on foreign policy.

The former New York City mayor has not always been so kind. In 2007 Giuliani and Romney became not just rivals, but enemies, focusing on each other over all the other candidates in the GOP field.

“They each see the other guy as their major contender,” analyst Stu Rothenberg told the Boston Globe in 2007. “Even though they can’t be guaranteed it’s going to be a two-man race, they figure if they begin to build some negatives on their opponent, it’s never too early to do that.”

It was Giuliani who first attacked Romney in a debate for hiring undocumented immigrants as landscapers. When Romney called New York a “sanctuary city,” Giuliani shot back that Romney lived in a “sanctuary mansion.” In another debate, Romney called Giuliani “a big spender from the big city.” Giuliani retorted that “I led. He lagged.” Romney called that “baloney.”

When Romney touted the line-item veto, Giuliani countered, “You have to be honest with people, and you can’t fool all of the people all of the time: the line-item veto is unconstitutional. ... The Supreme Court has ruled on it. So you can bang your head up against a stone wall all you want.”

Politicians often attack each other in primaries, then hug on a podium a few weeks later. But Giuliani’s criticisms of Romney continued long after his own presidential hopes died.

“He changed his position on virtually everything,” he said in February 2012. “I’m a moderate Republican, that’s what I am, so I’d be inclined to support someone like Mitt Romney. But all those changes give me pause.”

“I’ve never seen a guy change his position so many times, so fast, on a dime,” Giuliani said in December of 2011.

That same month, Giuliani told CNN that former House speaker Newt Gingrich “might actually be the stronger candidate, because I think he can make a broader connection than Mitt Romney to those Reagan Democrats. . . You won’t have this barrier of possible elitism that I think Obama could exploit pretty effectively.”

In June of 2011, when Giuliani was still flirting with another presidential bid, he called Romney’s health-care legislation a “terrible mistake” that was “almost exactly the same” as the national health-care law.

The long-simmering grudge appears to be mutual, though Romney has been far less vocal about it. According to the New York Times, Texas Gov. Rick Perry’s decision to back Giuliani in 2008 is a snub Romney has never forgotten.