Rafael Nadal, the 22-time Grand Slam champion, will retire from tennis at the end of this season.
The 38-year-old will represent Spain in his final appearance at next month's Davis Cup Finals in Malaga.
Nadal had previously indicated 2024 would be his final season after missing most of 2023 with a hip injury.
In a video message released on Thursday, Nadal said: "I am here to let you know I am retiring from professional tennis.
"The reality is that it has been some difficult years, the last two especially.
"I don't think I have been able to play without limitations."
Nadal retires as the second-most successful men's singles player of all time, behind only long-time rival Novak Djokovic.
Dubbed the 'King of Clay', Nadal won the French Open singles title a record 14 times, winning 112 of his 116 major matches at Roland Garros.
Nadal is also a four-time US Open champion and won both the Australian Open and Wimbledon twice.
He also won Olympic singles and doubles gold and helped Spain to five Davis Cup titles, most recently in 2019.
After returning to competitive action in Brisbane in January, he was sidelined again with a thigh injury.
Nadal played four tournaments during the European clay-court season, culminating in a first-round defeat at the French Open.
Since then he has played just two more tournaments - in Bastad and the Olympic Games at Roland Garros.
Last month he was included in Spain's squad for the Davis Cup Finals, which takes place between 19-24 November.
"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 ever have imagined," Nadal said.
"I’m very excited that my last tournament will be the final of the Davis Cup and representing my country."