PARIS- Former world number one Roger Federer, who is targeting a record 21st Grand Slam title at Wimbledon, withdrew from the French Open on Sunday, a day after winning a tough third-round match, opting to save himself for the grass-court season.

"After discussions with my team, I decided that I should withdraw from the French Open today," Federer said in a statement released by the French Tennis Federation.

"After two knee operations and more than a year of rehabilitation, it's important that I listen to my body and not rush back into competition," the 39-year-old Swiss added.

Federer, who has hardly played in the last 17 months because of a knee injury, suffered physically in his four-set, late-night victory over German Dominik Koepfer on Saturday and decided to end his Roland Garros campaign ahead of what would have been a punishing fourth-round match against Italian Matteo Berrettini.

He had said after Saturday's match that he was pondering whether to participate in the second week of the claycourt Grand Slam as his season goal was Wimbledon, the grass-court major starting on June 28.

"We go through these matches... we analyse them highly and look on what's next and we'll do the same tonight and tomorrow," he said.

"Because I need to decide if I keep on playing or not, or is it not too much risk at this moment to keep pushing or is this just a perfect way to just take a rest."

Tournament director Guy Forget said: "The French Open is sorry to see Roger Federer withdraw from the tournament but he put up a great fight last night.

"We were all delighted to see him back in Paris, where he played three top-level matches. We wish him all the best for the rest of the season."

Seven-times Grand Slam champion Mats Wilander paid tribute to Federer for his performance against Koepfer.

"I feel good that I saw Roger was in good enough shape to play like that," Eurosport pundit Wilander said. "You have a lot of people say they should retire when they get a little bit old if they cannot win a Slam.

"I am of the complete opposite opinion. I absolutely love and respect Roger Federer for what he did last night. He could have easily thrown in the towel and say 'I had a good enough practice for Wimbledon'.

"But no, he wants to win matches, I am just so impressed with him."

(Editing by Clare Fallon) ((Shrivathsa.Sridhar@thomsonreuters.com))