(CNN) -- The milestones keep coming for Roger Federer, but the tennis superstar had to dig deep at the French Open on Sunday before notching his 900th career win and reaching his 36th successive grand slam quarterfinal.
Federer made a flying start against home hope Gilles Simon, but then lost the next two sets to raise the prospect of his earliest defeat at a major tournament since he lost in the third round at Roland Garros to Gustavo Kuerten in 2004.
An uncharacteristic fall on the red clay by the Swiss in the seventh game of the second set heralded a change of momentum.
However, he regained his composure to triumph 6-1 4-6 2-6 6-2 6-3 and earn a clash with another Frenchman, sixth seed Jo-Wilfried Tsonga.
"It was a great atmosphere in which to play like this. It became difficult in the second set as Gilles turned it around," said the 17-time grand slam champion, who has lost only once in 23 times he has had to play five sets.
"I am proud of the record. It's a lot of years, a lot of sacrifices and a lot of matches like this."
Simon had won five-set matches in the first and third rounds, but was unable to reach the second grand slam quarterfinal of his career -- the only one being in Australia in 2009.
Federer, whose only French Open triumph was in 2009, became the fourth player to reach 900 wins -- Ivan Lendl was the last to do so in 1990.
The 31-year-old Swiss has won 81.5% of those matches, with just 204 defeats.
He has a 9-3 career record against Tsonga, who beat Serbia's Viktor Troicki 6-3 6-3 6-3 to reach the quarterfinals of his home event for the second successive year.
France has not had a male champion since Yannick Noah in 1983, and Tsonga is looking to make up for last year's heartbreak -- when he blew four match-points in a five-set defeat by world No. 1 Novak Djokovic.
"I'm playing well, so all the lights are green," the 28-year-old said. "Everything is positive. I have nothing to lose."
Fourth seed David Ferrer will take on this year's surprise package Tommy Robredo in an all-Spanish quarterfinal.
Robredo became the first man in 86 years to come back from two sets down in three successive matches in a grand slam as he defeated 11th-seeded compatriot Nicolas Almagro 6-7 (5-7) 3-6 6-4 6-4 6-4.
The 31-year-old, who this time last year had dropped from a career-high fifth in the rankings to a lowly 470th after 14 months out with injury, trailed 4-1 in the third set before launching an another incredible comeback.
"Maybe he had a little bit of doubt, though, in that moment," said 34th-ranked Robredo, who also reached the last eight in Paris in 2003, 2005 and 2009.
"Then I just pushed hard and I won the third. And then I was just dreaming and dreaming to try to do it again, and I did it."
Almagro, who has reached two finals on the ATP Tour this year, also led 4-2 in the fourth set and 2-0 in the decider.
"I had my ups and downs. These ups and downs cost me the match," said the 27-year-old, who also blew a two-set lead against Ferrer in January's Australian Open quarterfinals.
"I think Tommy produced a remarkable, admirable game. I have every respect for what he did. For my part, I need to move on as best I can."
Ferrer, a semifinalist last year, dropped just five games as he crushed South African 23rd seed Kevin Anderson 6-3 6-1 6-1.
"I'm very happy with my game today," said Ferrer, who has not lost a set in four matches. "Maybe I played the best match of this week."