Roger Federer will miss the French Open and no fewer than three other tournaments while he is sidelined for at least four months after having arthroscopic surgery on his right knee.

It's only the second operation for the 38-year-old Federer -- the other was on his left knee in 2016 -- and one that is certain to raise questions about his future in tennis.

He posted on social media Thursday that his knee had been an issue "for a little while."

"I hoped it would go away," he said.

The man who has spent more weeks ranked No. 1 than any other and owns a men's-record 20 Grand Slam titles said the operation was in his home country of Switzerland on Wednesday. He currently is ranked No. 3 behind rivals Novak Djokovic and Rafael Nadal.

"After the procedure, the doctors confirmed that it was the right thing to have done and are very confident of a full recovery," Federer wrote.

He ended up taking off the last six months of the season after his left knee surgery four years ago. When he returned, he won the Australian Open and Wimbledon in 2017, then the Australian Open again in 2018, his most recent major championship.

Last month in Melbourne, Federer was hampered by what he said was a groin muscle problem. He needed to erase seven match points to get past Tennys Sandgren in the quarterfinals, then was clearly not quite himself during a straight-set loss to Djokovic in the semifinals.

Now Federer, who for years has faced questions about how much longer he'll compete, will miss upcoming hard-court tournaments in Dubai, United Arab Emirates; Indian Wells, California; and Miami, along with what was supposed to be a rescheduled exhibition match in Bogota, Colombia, that was cancelled in November because of rioting there.

He also is going to sit out Roland Garros, the next Grand Slam tournament, which begins May 24. That means this will be the fourth time in the past five years that Federer is absent from the clay-court major that he won in 2009 to complete a career Grand Slam.

The French Open is the lone major title he's won just once; in fact, it is the only one he has not won at least five times.

Federer closed Thursday's message by saying: "see you on the grass!"

That is the surface he's excelled on the most, including a record eight championships at Wimbledon, where he was the runner-up on four occasions. That includes in 2019, when he held two championship points in the final against Djokovic before losing a fifth-set tiebreaker.

Play begins at the All England Club on June 29. Federer usually warms up for Wimbledon at the grass-court tournament in Halle, Germany, which starts June 15. He has won 10 titles at Halle.

------

AP Sports Writer Jerome Pugmire in Paris contributed to this report.