Jonathan Jurejko
BBC Sport tennis news reporter
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 has barely played over the past two seasons because of injuries and suggested last year he could retire at the end of the 2024 season.
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.
No player has won as many Grand Slam singles titles at the same tournament.
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 four Davis Cup titles, most recently in 2019.
Alongside enduring rivals Djokovic and 20-time major champion Roger Federer, Nadal formed the 'Big Three' that dominated the men's game from the early 2000s and drew in legions of fans.
"What a career, Rafa! I always hoped this day would never come," Federer, who famously cried alongside Nadal when he retired in 2022, said.
"Thank you for the unforgettable memories and all your incredible achievements in the game we love.
"It's been an absolute honour."
Why Nadal has decided now is the right time?
When announcing he would not play in the 2023 French Open, Nadal said he planned to retire at the end of 2024 because of the series of injuries which were taking their toll on his body.
But, having returned earlier this season, Nadal became increasingly non-committal about his future.
The former world number one regularly said he wanted to keep playing as long as his body let him.
Now, after a chastening defeat by long-time rival Djokovic at the Paris Olympics in July, he has decided the time is right.
"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."
After returning to competitive action in Brisbane in January, Nadal was sidelined again with a thigh injury, missing the Australian Open.
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."
From Mallorca kid to the King of Clay
Nadal was aged three when he was introduced to tennis by his uncle Toni, who encouraged him to transition to playing left-handed after seeing how strongly he could hit the ball.
He turned professional aged 15 and three years later helped Spain win the 2004 Davis Cup as they beat the United States, with Nadal defeating world number two Andy Roddick.
The following year, he began his dominance of the French Open, beating Argentina's Mariano Puerta in the final.
Nadal's five-set win over Federer in the 2008 Wimbledon final - an epic that finished 12 minutes short of five hours - is regarded as one of the best matches in history and one of the pinnacles of their 15-year rivalry.
In between those two finals, he won the 2009 Australian Open for the first time with another five-set victory over Federer, and completed the career Grand Slam at the 2010 US Open.
Although he won all four majors, Nadal will forever be synonymous with the French Open, where a metallic statue of him hitting his trademark forehand was built in 2021.
From 2005 to 2014, he won nine of 10 Roland Garros titles and then five of six between 2017 and 2022.
In 14 final appearances, he was never taken to five sets, beating Federer in four finals and Djokovic three times.
Of his four French Open losses, Djokovic defeated him twice with Alexander Zverev this year and Robin Soderling in 2009 the other two men to topple him.
Fittingly, his final major title came at the French Open in 2022, two days after his 36th birthday.
Nadal's success and longevity is even more remarkable considering the series of longer-term injuries - affecting his elbow, ankle, knee, wrist, back, hip and abdomen - he dealt with throughout.
'Tough news for the tennis world' - reaction
Jannik Sinner, current men's world number one, said: "It's tough news for all the tennis world. I was very lucky to get to know him and he's an unbelievable person.
"He gave to all of us a lot of emotions when we saw him playing."
Coco Gauff, women's world number four, on Instagram: "You are amazing! It's been so incredible to witness your greatness and work ethic and be able to learn from it."
Casper Ruud, who lost to Nadal in the 2022 French Open final, on Instagram: "RAFA Forever! Thank you for everything legend."
The French Open's official X account: "14 thanks for the millions of memories!"
The ATP Tour's official Instagram account: "There are no words for how this feels, the day we wished would never come. You have given us all the most incredible moments and memories."
The Australian Open's X account: "Legendary memories. You are so loved around the world and here with us in Australia. Grateful for all the unforgettable moments. Gracias, Rafa. For everything!"
Wimbledon's official Instagram account: "Thank you for everything, Rafa."
Real Madrid and France footballer Kylian Mbappe on Instagram: "Well done on your career Rafa, you're an example as a player and a person. You will always be a legend"
Rafa's roll of honour
22 Grand Slam singles titles
Australian Open: 2 (2009, 2022)
French Open: 14 (2005, 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014, 2017, 2018, 2019, 2020, 2022)
Wimbledon: 2 (2008, 2010)
US Open: 4 (2010, 2013, 2017, 2019)
2 Olympic golds
Singles: 2008; Doubles: 2016
4 Davis Cups
2004, 2009, 2011, 2019
92 ATP Tour titles
209 weeks as world number one