PARIS -- Chasing a shot, Roger Federer caught his right shoe in the French Open's red clay, twisting that foot awkwardly and tumbling to the ground.
Soon enough, he was in a real rut, in danger of his earliest exit from a Grand Slam tournament in nine years.
Federer regrouped and restored order eventually, coming back from a two-sets-to-one deficit to beat 15th-seeded Gilles Simon of France 6-1, 4-6, 2-6, 6-2, 6-3 Sunday in the fourth round to reach his 36th consecutive major quarterfinal.
"I didn't hurt myself or anything," Federer said. "But maybe I did lose that touch of confidence for a little bit, and then I was out of the match there for a bit."
During a rare stretch of mid-match mediocrity from the owner of a record 17 Grand Slam championships -- the 2009 French Open trophy is part of his collection -- Federer lost 10 of 13 games, including the one in which he fell.
"I didn't give him time," said Simon, a one-time Grand Slam quarterfinalist. "I managed to start moving him around a bit."
But Simon, a former member of the top 10, could not keep Federer down. Able to "tidy up my play," as he put it, Federer went from hitting more than twice as many unforced errors as Simon in the second and third sets, 25-12, to generating more than twice as many winners in the fourth and fifth, 29-14.
"When things turn nasty," Simon said, "he responds well."
Federer said the match will give him "a lot of info" heading into his quarterfinal against another Frenchman, No. 6-seeded Jo-Wilfried Tsonga.
Federer's turnaround was not the biggest of the day. Not even close. That distinction belonged to 32nd-seeded Tommy Robredo of Spain, who is specializing in comebacks: He is the first man in 86 years to win three Grand Slam matches in a row after dropping the first two sets (France's Henri Cochet pulled that off at Wimbledon in 1927).
Robredo did it in the second round Wednesday. He did it in the third round Friday. And then he did it in the fourth round Sunday, defeating No. 11 Nicolas Almagro 6-7 (5), 3-6, 6-4, 6-4, 6-4. Robredo trailed 4-1 in the third set, 4-2 in the fourth and 2-0 in the fifth.
"Nobody dreams of doing such things," said Robredo, who dropped to his knees, leaned forward and wept after winning.
"I don't know what adjective to use," he said.
Robredo's first French Open quarterfinal since 2009 -- he missed the tournament in 2011 and 2012 because of left leg problems that required surgery -- will be against another Spaniard, No. 4 David Ferrer, who eliminated No. 23 Kevin Anderson of South Africa 6-3, 6-1, 6-1.
Tsonga, the 2008 Australian Open runner-up, got past Viktor Troicki 6-3, 6-3, 6-3. Tsonga is 3-9 against Federer, but he did come back from a two-set hole to win their 2011 Wimbledon quarterfinal.
"I know he can beat me, and he knows he can beat me," Federer said. "But I'm going to make sure that doesn't happen."
So far, all of the top three men in the tournament -- No. 1 Novak Djokovic, No. 2 Federer and No. 3 Rafael Nadal, the seven-time champion -- have had issues. Nadal lost a set in each of his first two matches; Djokovic needed his upper right arm treated by a trainer Saturday.
Federer changed the direction of things against Simon pretty quickly, exhorting himself more than usual with fist-shaking and yells of "Come on!"
From 2-2 in the fourth set, Federer won seven consecutive games. That was pretty much that, although the final game sure was tense. Simon held two break points, but Federer erased one with a service winner, the other with a big serve that set up a putaway. On Federer's second match point, Simon pushed a backhand wide on a 10-stroke exchange.
When they met at the net, Simon extended his hand for a shake -- and Federer pulled him in for an embrace.
The victory was Federer's 58th in his French Open career, against 13 losses, equaling the mark for most tournament wins held by Guillermo Vilas and Nicola Pietrangeli. It also was Federer's 900th career victory anywhere, which puts him fourth in men's tour history, behind only Jimmy Connors, Ivan Lendl and Vilas.
Sunday's drama came in the same stadium where Federer's streak of 23 Grand Slam semifinals in a row ended with a loss in the 2010 quarterfinals to Robin Soderling.
Federer's major quarterfinal run, a record in the 45-year Open era, began at Wimbledon in 2004, shortly after he lost in the third round of the French Open to three-time titlist Gustavo Kuerten.
"This isn't just a one-week thing or one-year thing," the 31-year-old Federer said. "The number is unbelievable. I probably would have been happy with one (quarterfinal) at one point in my career."
On Sunday, pursuing a ball in his backhand corner while ahead 3-2 in the second set, Federer landed hard on his right knee as he went down when his right sneaker's toe stuck in the clay. When Federer rose, dirt was caked along his right leg.
Simon's shot there made the score 3-all. Appearing shaken, Federer double-faulted to begin the next game, then was broken when he sailed a forehand far beyond the baseline. That set would become the first Federer had lost all tournament. And then he was broken at love to trail 3-2 in the third set, which Simon soon won, too.
As the fourth set began, thousands of fans joined in a chorus of support not for the Frenchman trying to pull off the upset, but his opponent. "Ro-ger! Ro-ger!" they cried, trying to will Federer to perform better.
Simon also heard his fair share of support, with chants of his nickname ringing out around Court Philippe Chatrier -- "Gil-lou! Gil-lou!"
"Today definitely reminded me what Simon's first name was," Federer joked afterward. "I heard that throughout the entire match. But I enjoyed it. It's always nice being part of an atmosphere like the one we had tonight."
The fifth set was mostly one-sided, similar to the first. The next-to-last point of that opening set was a thing of beauty, as Federer stretched beyond the doubles alley to sling a forehand that wrapped around the net post and landed in a corner.
Little could he -- or Simon -- have known there was trouble ahead.
Information from The Associated Press was used in this report.