(CNN) Roger Federer has pulled out of this year's French Open after undergoing knee surgery.

The Swiss star announced on his Twitter page that he had been dealing with pain in his right knee for a "little while."

The 38-year-old underwent arthroscopic surgery in Switzerland Wednesday which will rule him out for the second grand slam of the season in Paris, France.

Federer will also miss a number of big tournaments before the Roland Garros event but is hopeful of returning in time for the grass court season later in the year.

"My right knee has been bothering me for a little while. I hoped it would go away, but after an examination, and discussion with my team, I decided to have arthroscopic surgery in Switzerland yesterday," Federer said.