Novak Djokovic believes Rafael Nadal's "legacy will live forever" as the 24-time major winner paid tribute to his great rival.

Nadal announced on Thursday via a video on his social media platforms that he will retire from competitive tennis following next month's Davis Cup finals in Malaga.

It brings the curtain down on a glittering career in which he won 22 grand slams, including a record 14 French Open singles triumphs.

His major tally was then a record, but has since been surpassed by Djokovic, against whom he contested what many believe to be tennis' greatest rivalry.

The pair faced off 60 times, including nine times in slam finals, with the Serb boasting a narrowly superior 31-29 record, while he prevailed in their final clash at the Paris Olympics.

And Djokovic has followed suit in paying tribute to the Spaniard, who was dubbed "the King of Clay" for his exploits at Roland-Garros.

"Rafa, one post is not enough to express the respect I have for you and what you have done for our sport," he wrote on his social media platforms.

"You have inspired millions of children to start playing tennis, and I think that's probably the greatest achievement anyone can wish for.

"Your tenacity, dedication, fighting spirit are going to be taught for decades. Your legacy will live forever. Only you know what you had to endure to become an icon of tennis and sport in general.

"Thank you for pushing me to the very limit so many times in our rivalry, which has impacted me the most as a player.

"Your passion for representing Spain has always been remarkable. I wish you the best possible farewell in Malaga with the Davis Cup team of Spain. I will be there in person to pay respect to your stellar career."