Roger Federer is sitting out the rest of this season, including the Rio de Janeiro Olympics and U.S. Open, to protect his surgically repaired left knee.

Federer wrote on his Facebook page Tuesday that he needs “more extensive rehabilitation following my knee surgery earlier this year.”

“The doctors advised that if I want to play on the ATP World Tour injury free for another few years, as I intend to do, I must give both my knee and body the proper time to fully recover,” Federer said.

The owner of a record 17 Grand Slams titles turns 35 on Aug. 8, so the reference to “another few years” might give his fans increased hope of seeing Federer continue to wield a racket for quite some time.

His agent, Tony Godsick, wrote in an email to The Associated Press that Federer plans to “be ready for the start of next year.”

Federer is the first member of tennis’ so-called “Big 4” – a group that also includes No. 1-ranked Novak Djokovic, 14-time major champion Rafael Nadal and 2012 gold medalist Andy Murray – to pull out of the Rio Games, where that sport’s competition starts Aug. 6, a day after the opening ceremony.

Federer often has spoken about how much the Olympics mean to him, in part because he met his wife, Mirka, when both were athletes at the 2000 Sydney Games. Federer won a silver medal in singles for Switzerland four years ago in London and teamed up with Stan Wawrinka to win a gold medal in doubles at the 2008 Beijing Olympics.

In Brazil, Federer was expected to play singles, doubles with Wawrinka and mixed doubles with Martina Hingis.

He is the second big draw who will be missing from the Rio tennis tournament: Maria Sharapova won’t be there because she’s serving a two-year doping ban.

The arthroscopic procedure Federer had on his knee in February, repairing torn cartilage, was his first operation. Federer said he got hurt while preparing a bath for his twin daughters.

He’s also had back issues this season, missed the French Open to end his record 65-appearance streak at major tournaments and didn’t win a title of any sort in 2016 – the first year since 2000 that he will finish without at least one trophy.

So after participating in every Grand Slam tournament from the 2000 Australian Open through the 2016 Australian Open, Federer will sit out two of the last three this year. He is a five-time champion at the U.S. Open and was the runner-up there to Djokovic last year.

Federer, who has spent more weeks at No. 1 than anyone in the ATP computerized rankings, sits at No. 3, having gone 21-7 this season. Depending on how other players fare, Federer’s ranking will tumble the rest of the year.

Federer hasn’t played since losing to Milos Raonic in the Wimbledon semifinals early this month.