Roger Federer was in danger of his earliest exit at a Grand Slam since 2004 before he fought back to beat Gilles Simon over five sets at the French Open.
The Swiss, 31, won the fourth-round encounter 6-1 4-6 2-6 6-2 6-3, extending his run of consecutive Grand Slam quarter-finals to 36 and racking up his 900th career win.
That looked a distant prospect when Federer trailed two sets to one, but he dominated the latter stages to set up a last-eight match against Jo-Wilfried Tsonga.
After a straightforward first set, Federer's fortunes took a sharp turn when he fell while sliding for a backhand in the sixth game of the second set.
"I didn't hurt myself or anything," he said afterwards. "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.
"But I think more credit to him, because I wasn't bothered by the fall in any way, actually. If anything, [it was] mentally, or maybe it gave him a mental boost. Who knows what it was."
Simon, 28, had lost his last three matches against Federer, including a 6-1 6-2 drubbing in Rome last month, but now playing more aggressively the Frenchman reeled off nine of the next 12 games to move within a set of a famous victory.
But with the match in danger of slipping away, Federer leapt on the first chance of the fourth set.
He cracked a forehand to break for 4-2 before the now-faltering Simon netted a backhand to give up another break and the set.
The momentum had shifted decisively and the crowd on the main Court Philippe Chatrier were giving 2009 champion Federer at least as much support as the home player.
Federer surged through seven straight games to take a stranglehold on the match, and survived a couple of nervy volleys and a break point in the final game to claim his customary place in the last eight.
"I'm happy I found a way and took the right decisions and was able to sort of tidy up my play a little bit, not spray that many unforced errors, even though I don't think it was that bad," Federer added.
"You're always going to hit some against Gilles because he does a great job retrieving.
"Overall I'm very happy. I stayed calm under pressure, and it's always fun being part of matches like this."