Rafael Nadal and Roger Federer's rivalry started in the sweltering heat of Miami and ended almost two decades later in tears and hand-holding in an emotional London farewell.

In between, the great friends met 40 times, battling out epics on European clay, London grass and hard courts from the United States to Australia.

Nadal edged their head-to-head count 24-16, coming out 9-3 on top in Grand Slam finals including his stunning Wimbledon triumph in 2008, widely regarded as one of the greatest finals at the majors.

However, the statistics only scratch the surface.

"When Roger leaves the tour, an important part of my life is leaving too," admitted a tearful Nadal as he played Laver Cup doubles alongside 41-year-old Federer in the Swiss star's final appearance last September.

The two clasped hands as Federer hobbled into retirement.

On Thursday, Nadal revealed that he too is facing the end of the line with 2024 likely to be his swansong after withdrawing from this year's French Open with a hip injury.

"Very proud to be part of his career but even for me happier to finish our career as friends after everything we shared on court as rivals," said Nadal.

When Nadal equalled Federer's haul of 20 Grand Slam titles by lifting his 13th French Open in 2020, the Swiss described it as the "greatest achievement in sport".

Federer never begrudged Nadal moving past him to 22 majors.

"I can call up Rafa and talk about anything," said Federer at his emotional farewell in London.

"We enjoy each other's company. We have a million topics to cover. I always feel like any evening we ever spent together we never have enough time."

Nineteen years earlier, it was another time, another place.

The only thing they had in common then was respect.

When they met for the first time in March 2004 at Miami, Nadal was just 17 and ranked at 34.

Federer was the world number one and had already captured the Australian Open and Indian Wells titles that year.

However, a fearless Nadal swept to a 6-3, 6-3 victory in 70 minutes.

"I was very worried about him beating me 6-1, 6-1 or 6-1, 6-2, but I really wanted to play this match against the world number one," said Nadal.

Nadal fretted if his friends back home could follow the match "on Teletext" while Federer correctly predicted more meetings to come.

"I was impressed with what I saw," said Federer.

- Wimbledon epic -

 

The pair met at least once every year from 2004 until 2015 while Federer would go on to claim seven of their last eight clashes.

Fittingly, they split their last meetings in 2019 -- Nadal breezing to a semi-final triumph at the French Open with Federer coming out on top in the last four at Wimbledon just weeks later.

Epics were often guaranteed.

Federer avenged his 2004 loss to Nadal 12 months later, winning the final in Miami in five sets from two sets down.

Nadal had to dig deep to protect his king of clay reputation in 2006, also needing five sets to defeat the Swiss in the Rome final.

Federer struggled to chip away at Nadal's mastery of clay, winning just two of 17 meetings.

At the Swiss star's second home of Wimbledon, he defeated Nadal in the 2006 and 2007 finals before the Spaniard claimed one of his greatest victories 12 months later.

In almost total darkness after a final interrupted by rain, Nadal won his fifth Grand Slam title and first outside of the French Open.

He missed two championship points in the fourth set but steadied to triumph 6-4, 6-4, 6-7 (5/7), 6-7 (8/10), 9-7 after four hours and 48 minutes.

"For me, it was the most emotional match I ever played in, probably the best," said Nadal.

They would meet again in three more Slam finals -- Nadal taking his first Australian Open title in a five-setter in 2009 and the 2011 French Open before Federer claimed the 2017 Australian Open in another marathon.

Federer's win in Melbourne came after he had spent six months sidelined by injury the previous year.

"Tennis is a tough sport," said Federer who was 35 at the time and had gone 10 years without a victory over Nadal at the Slams.

"There are no draws. If there were, I would have been happy to accept one and share it with Rafa."