The 39-year-old has undergone two knee operations in 2020.
“I am very disappointed because it has been an honor and a highlight of my career every time I have represented Switzerland,” Federer wrote in a statement. “I have already started rehab in hopes of returning to the tour later this summer.”
Federer, a 20-time Grand Slam champion, competed in each of the Olympics between 2000 and 2012, winning men’s doubles gold in Beijing in 2008 and men’s singles silver in London in 2012. He missed the Olympics from 2016 due to a knee injury.
He recently played at Wimbledon where he was eliminated from the tournament in the quarterfinals. He last won a Grand Slam tournament in January 2018 at the Australian Open.
Federer joins a growing list of players forgoing the chance to win Olympic gold this summer for a variety of reasons.