Spanish tennis legend Rafael Nadal announced on Thursday he will retire from professional tennis after he represents his country in the Davis Cup next month.

Nadal, 38, is arguably one of the greatest tennis players to ever play the sport – possibly only matched by two of the all-time greats that played in his era in Roger Federer and Novak Djokovic.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Rafael Nadal upset

Rafael Nadal reacts against Frances Tiafoe during their Men’s Singles Fourth Round match on Day Eight of the 2022 US Open at USTA Billie Jean King National Tennis Center on Sept. 5, 2022 in the Flushing neighborhood of the Queens borough of New York City. (Mike Stobe/Getty Images)

Nadal won 22 Grand Slam titles during his illustrious career and two gold medals, one in singles competition and the other in doubles.

"Hello everyone, I’m here to let you know I am retiring from professional tennis," Nadal said in a video posted to his X account.

Nadal said the last two years of his career have been the most difficult as he has dealt with numerous injuries that have kept him sidelined from Grand Slams. He lamented not being able to play the sport he has dominated for years without limitations.

STEFANOS TSITSIPAS REFUSES TO PLAY IN MELTDOWN AT SHANGHAI MASTERS, ACCUSES UMPIRE OF BIAS

Rafael Nadal exits the Australian Open

Rafael Nadal acknowledges the spectators after the men's singles 2nd round match against Mackenzie McDonald of the United States at the Australian Open tennis tournament in Melbourne, Australia, on Jan. 18, 2023. (Bai Xuefei/Xinhua via Getty Images)

"It is obviously a difficult decision, one that has taken me some time to make," he said. "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 has won the French Open 14 times, the U.S. Open four times and won twice at the Australian Open and Wimbledon respectively. He racked up gold medals in 2008 in Beijing and 2016 in Rio de Janeiro.

He has been on four Davis Cup-winning teams in his career, and he is hoping to go out on top.

"I am very excited that my last tournament will be the final of the Davis Cup and representing my country. 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 Sevilla in 2004."

Nadal thanked his supporters, colleagues and rivals who he’s been with over the last 20 years.

"I leave with absolute peace of mind of having given my best of having made an effort in every way," he added.

Rafael Nadal backhand

Rafael Nadal plays a backhand against Alexander Zverev in the Men's Singles first round match on Day Two of the 2024 French Open at Roland Garros on May 27, 2024 in Paris. (Mateo Villalba/Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

"I can only end by saying a thousand thanks to all and see you soon."

Follow Fox News Digital’s sports coverage on X, and subscribe to the Fox News Sports Huddle newsletter.