Federer, a 20-time Grand Slam champion, announced on Thursday that he would retire after the Laver Cup this month.
“It’s a sad day for me personally and for sports around the world.”
Nadal defeated Federer 24 times in 40 matches during one of the most celebrated rivalries in tennis history.
“It’s been a pleasure but also an honour and privilege to share all these years with you, living so many amazing moments on and off the court,” Nadal said.
“We will have many more moments to share together in the future, there are still lots of things to do together, we know that.
“For now, I truly wish you all the happiness with your wife, Mirka, your kids, your family and enjoy what’s ahead of you. I’ll see you in London.”
Federer made his professional debut aged 16 in 1998 and won his first Grand Slam title at Wimbledon in 2003.
The chairman of the All England Lawn Tennis Club, Ian Hewitt, congratulated Federer on a “truly remarkable career”.
“He will forever be celebrated as one of our greatest Wimbledon champions, having lifted the trophy eight times from his 22 appearances at the All England Club,” Hewitt added.