Updated

Roger Federer extended his incredible run of Grand Slam quarterfinal appearances on Sunday with a fourth-round win at the French Open, but had to dig deep in a five-set thriller against Frenchman Gilles Simon to do it.

Federer pulled out a 6-1, 4-6, 2-6, 6-2, 6-3 triumph on Court Chatrier to advance to the second week at Roland Garros, pushing his consecutive string of major quarterfinal appearances to 36 -- or basically nine straight years. The Swiss superstar last failed to reach the round of eight in a Grand Slam at the 2004 French Open when he lost to Gustavo Kuerten in the third round.

"When you win you can enjoy it more, because it can be a very, very frustrating game, as well," said Federer, who recorded the 900th match win of his career on Sunday. "At the end, let's not forget only one guy ever wins the tournament. All the other guys go home with nothing. So it can be tough depending on how you see it.

"That's where these wins have definitely helped me continue working hard, be motivated, loving it so much and being part of great matches. And that I came out so often on the winning side is obviously amazing for me."

The 17-time Grand Slam champion was a bit shaky in the second and third sets, missing easy forehands and backhands as Simon thrilled the home crowd to grab a surprising lead of two sets to one.

Federer, as he often has, regrouped and ran off seven straight games over the fourth and fifth sets to take control.

Simon, who controlled many points during the second and third sets with powerful forehands and a strong serve, finally began to wilt in playing his third five-setter in four matches.

Federer broke serve for 4-2 in the fourth set when Simon failed to return a blistering forehand, then slipped a volley past a charging Simon after the Frenchman had raced in for a drop shot to make it 5-2. He broke again in the next game when Simon netted a backhand to force a decisive set.

After an easy hold, Federer broke for a 2-0 lead in the fifth thanks to a long forehand by Simon to end a lengthy rally. Following another Federer hold, Simon did all he could just to win the next game, saving a number of Federer break-point opportunities.

An ace gave Federer a 4-1 lead, but Simon tried to make it interesting in the final game. A Federer ace saved one break point and Simon then saved a match point before gaining another break point. Federer again used a big serve to set up a smash and two Simon backhand errors finally ended the nearly three- hour match.

Federer broke Simon three times in a dominant first set, but took a slight tumble in the second set and appeared unsure of himself for most of the next two sets. He was broken soon after the fall, giving Simon the second set and again struggled in the third.

Simon came up with a break for a 3-2 lead, then fought back from 0-30 down in the very next game to hold before Federer misplayed a volley into the net to hand the Frenchman a second break for a 5-2 edge. Federer saved one set point in the next game with a brilliant stab volley at a Simon pass, but couldn't do so again. He netted a simple backhand to give Simon the third set.

Federer, though, had the answer and improved to 6-0 lifetime in five-setters at Roland Garros.

Next up for the 2009 champ and this year's second seed will be another Frenchman in Jo-Wilfried Tsonga. The sixth seed had a much easier time Sunday with a 6-3, 6-3, 6-3 pasting of Serbia's Viktor Troicki.

Tsonga, the winner in Marseille earlier this year, is into the quarterfinals at his home Slam for the second straight year.

"It's always good to win in straight sets," said Tsonga. "I'm playing well, so all the lights are green. I will have a big match in the next round and hope I will play my best tennis. Everything is positive. I'm in the quarterfinals here at Roland Garros for the second time. I have nothing to lose."

Tsonga is 3-9 lifetime against Federer, which includes a five-set loss in the Australian Open quarterfinals back in January. Tsonga stunned Federer in the 2011 Wimbledon quarters and their lone meeting on clay ended with a Federer win in Rome two years ago.

Spaniards David Ferrer and Tommy Robredo were also fourth-round winners Sunday.

The fourth-seeded Ferrer needed an 1 hour and 45 minutes to dispatch South Africa's Kevin Anderson, 6-3, 6-1, 6-1, while Robredo became just the second man to come back from 0-2 down in three straight Grand Slam matches when he escaped with a 6-7 (5-7), 3-6, 6-4, 6-4, 6-4 victory over fellow Spaniard Nicolas Almagro.

Robredo had previously rallied from two sets down to beat Igor Sjisling in the second round and Gael Monfils in the third. The only other man to win three straight in such fashion at a major championship was Frenchman Henri Cochet in 1927 at Wimbledon. Robredo will now get two days to rest before his quarterfinal match against Ferrer on Wednesday.

Ferrer, a semifinalist last year at Roland Garros, has not dropped a set in four matches this week. The Spaniard broke serve six times on Sunday and saved both break points against his serve. Anderson committed a whopping 41 unforced errors to Ferrer's 11.

"I'm very happy with my game today," said Ferrer. "Maybe I played the best match of this week. I am in the second week of the Grand Slam, and now I want to rest and to be focused on the next match."

Robredo, seeded 32nd, had missed the French Open each of the last two years because of injuries and earlier in 2013 earned his first win in two years with a title at Casablanca. The former world No. 5 has matched his farthest Grand Slam run, with prior quarterfinal appearances at the French Open in 2003, 2005, 2007 and 2009, along with a round of eight result at the Australian Open in 2007.

"I think that being in the quarterfinals again, it's amazing, and also with three comebacks the way I did," said Robredo. "I just need to enjoy it because I think that in tennis, we need to enjoy it when we do great things and keep focused."

The fourth round will continue on Monday with the top half of the draw. Top- seeded Novak Djokovic will face Germany's Philipp Kohlschreiber and seven-time champion Rafael Nadal will meet Japan's Kei Nishikori. Also, Germany's Tommy Haas will take on Russian Mikhail Youzhny and French seventh seed Richard Gasquet will tangle with ninth-seeded Swiss Stanislas Wawrinka.