Rafael Nadal of Spain holds the Championship trophy after winning the Men's Singles Final match against Tomas Berdych of Czech Republic on Day Thirteen of the Wimbledon Lawn Tennis Championships at the All England Lawn Tennis and Croquet Club on July 4, 2010 in London, England. (Julian Finney/Getty Images via CNN Newsource)

(CNN) โ€” Tennis legend Rafael Nadal has announced his upcoming retirement from the sport after a glittering career in which he amassed 22 grand slam titles.

Widely regarded as one of the greatest tennis players of all time, Nadalโ€™s final tournament will be with Spain at the Davis Cup finals in November.

The 38-year-old last played at the Paris Olympics but continuing injury struggles, which have hampered him throughout his career, have severely limited his time on the court over the past two seasons.

โ€œHello everyone, Iโ€™m here to let you know that I am retiring from professional tennis,โ€ Nadal said in a video posted on social media. โ€œThe reality is that is has been some difficult years, these last two especially. I donโ€™t think I have been able to play without limitations.

โ€œIt is obviously a difficult decision, one that has taken me some time to make. But in this life, everything has a beginning and an end.

โ€œAnd I think itโ€™s the appropriate time to put an end to a career that has been long and much more successful than I could have ever imagined.โ€

Nadal, who was forced the skip last monthโ€™s Laver Cup over fitness concerns, announced last year that 2024 would likely be his last season on the tour.

His 22 grand slam titles are the second-most in history of menโ€™s tennis behind only Novak Djokovic, his great long-time rival, as are his 36 Masters 1000 titles.

Nadal has also won singles and doubles gold for Spain at the Olympics and led his country to five Davis Cup titles.

Dubbed the โ€œKing of Clayโ€ due to his remarkable dominance on the surface, Nadal won 14 of his grand slams at the French Open and lost just four of his 116 matches in Paris.

He also won the US Open four times and the Australian Open and Wimbledon twice, while his victory over Roger Federer in the 2008 Wimbledon final is widely considered the greatest tennis match of all time.

โ€œI am very excited that my last tournament will be the final of the Davis Cup and representing my country,โ€ Nadal added. โ€œI think Iโ€™ve come full circle since one of my first great joys as a professional tennis player was the Davis Cup final in Seville in 2004. I feel super, super lucky for all the things Iโ€™ve been able to experience.

โ€œI want to thank the entire tennis industry. All the people involved in this sport, my long-time colleagues, especially my great rivals. I have spent many, many hours with them and I have lived many moments that I will remember for the rest of my life.

โ€œTalking about my team is a little bit more difficult for me because in the end, my team has been a very important part of my life. They are not co-workers, they are friends. They have been by my side at all the times I have really needed them. Very bad moments, very good moments.โ€

Nadal had suggested throughout the season that he could continue playing into next year if his body allowed him to be competitive.

After missing the majority of 2023 due to a hip injury, Nadal returned to competitive tennis at the Brisbane Open in January but was forced to miss the Australian Open with a thigh injury.

He has played in only six tournaments since then, most recently the Paris Olympics where he lost to Djokovic in the second round of the menโ€™s singles.

โ€œI leave with the absolute peace of mind of having given my best, of having made an effort in every way,โ€ he said.

Federer, whose rivalry with Nadal is arguably the greatest in tennis history, said it was an โ€œhonorโ€ to play against the Spaniard. The pair shared a tearful moment that went viral during Federerโ€™s own retirement ceremony in 2022.

โ€œWhat a career, Rafa!โ€ Federer wrote on Instagram. โ€œI always hoped this day would never come. Thank you for the unforgettable memories and all your incredible achievements in the game we love. Itโ€™s been an absolute honor!โ€