Roger Federer announced on Tuesday he has withdrawn from the upcoming Tokyo Olympics after a "setback" in his recovery from a knee injury.
The 20-time Grand Slam champion was knocked out of Wimbledon in the quarter-finals by Hubert Hurkacz last week.
The 39-year-old Federer, who has never won an Olympic singles gold medal, underwent two surgeries on his right knee in 2020.
"During the grass court season, I unfortunately experienced a setback with my knee, and have accepted that I must withdraw from the Tokyo Olympic Games," Federer said in a statement on social media.
The tennis competitions in Japan are set to start on July 24, the day after the opening ceremony.
Federer, who turns 40 next month, pulled out of the French Open after reaching the fourth round, hoping to get fit for Wimbledon.
He showed signs of his best during his run to the quarter-finals, but bowed out tamely, losing 6-3, 7-6 (7/4), 6-0 to Poland's Hurkacz.
That defeat sparked talk among fans and pundits speculating whether the eight-time Wimbledon winner would retire, with Federer saying he "didn't know" if his Wimbledon career was over.
But on Tuesday, the former world number one said he was hoping to return to the ATP Tour later this summer.
"I have already begun rehabilitation in the hopes of returning to the tour later this summer," he added.
"I wish the entire Swiss team the best of luck and I will be rooting hard for the team from afar."
He is just the latest to join a long list of tennis stars to skip the Olympics.
Rafael Nadal, Serena Williams and Dominic Thiem have all pulled out, while newly-crowned Wimbledon champion Novak Djokovic put his chances of playing in Tokyo at "50/50".
The Games have been badly affected by Covid. The 2020 edition was delayed by a year and although it will go ahead, it will largely be held behind closed doors and with strict health restrictions in place.
The Olympic singles title is the only major tournament Federer is yet to win. He has completed the career Grand Slam and won the season-ending ATP Finals six times.
He lost in the semi-finals in 2000 in Sydney and reached the final in 2012, only to be beaten by Andy Murray in London, just weeks after edging out the Briton on the same Centre Court in the Wimbledon final.
Federer did, however, win doubles gold with Stan Wawrinka in Beijing 13 years ago.
- 'Need to get in better shape' -
The loss to Hurkacz was only Federer's 14th defeat at Wimbledon in 119 matches, and the first time he had been beaten in the tournament in straight sets since a first-round exit at the hands of Mario Ancic in 2002.
It was also the first time he had lost a set 6-0 at Wimbledon and just the third time at a Slam.
"With everything that comes after Wimbledon, we were always going to sit down and talk about it because clearly now Wimbledon is over," Federer said after the match.
"I got to take a few days. Just see, okay, what do I need to do to get in better shape so I can be more competitive."
He slipped to ninth in the ATP rankings after Wimbledon -- his lowest position since March 2017.
"Rest up, @rogerfederer," Wimbledon tweeted. "It was great having you back this year."