Roger Federer, a 20-time Grand Slam singles champion, will retire from top-level tennis after the Laver Cup in London later this month.
Swiss Federer, 41, has not played since Wimbledon 2021, after which he had a third knee operation.
“My body’s message to me lately has been clear,” Federer said.
“I have played more than 1,500 matches over 24 years. Now I must recognise when it is time to end my competitive career.”
He added: “To the game of tennis, I love you and will never leave you.”
Only Spain’s Rafael Nadal, with 22 majors, and Serbia’s Novak Djokovic, with 21, have more men’s Grand Slam singles titles than Federer.
Federer made his professional debut aged 16 in 1998 and won his first Grand Slam title at Wimbledon in 2003.
He ends his career with a record total of eight men’s singles victories at the All England Club.
Federer’s final Grand Slam triumph came at the 2018 Australian Open when, aged 36, he became the second-oldest man to win a major singles title in the Open era.
After rising to world number one for the first time in 2004, he spent 310 weeks as the leading player on the ATP Tour during his career – a record until he was surpassed by Djokovic in February 2021.