The last time Roger Federer lost before the quarterfinals at a Grand Slam, Facebook was three months old, Rafael Nadal had never played, let alone won, the French Open, and John Kerry looked like he might become the next President of the United States. That defeat came in 2004 to Gustavo Kuerten, in the third round at Roland Garros. Today, in his round-of-16 match against Gilles Simon, it appeared for a time as if Federer's nine-year, 35-major quarterfinal streak might come to an end on the same court.

The period of fear began with Federer up a set and 3-2 in the second. That's when he twisted his right foot while stretching for a ball and fell to the clay. Later, Federer said that he lost his confidence after the tumble. That may have been something of an understatement. His game completely deserted him for the next set and-a-half; Federer lost 10 of the next 13 games and went down two sets to one. He was misfiring with everything—serve, forehand, backhand, drop shot—and he was slow to react to Simon’s own shots, which have never been the most intimidating on tour. The Frenchman, who beat Federer in Toronto and Shanghai in 2008 and took him to five sets at the Australian Open in 2011, should be credited for seizing his opportunity. After looking borderline comatose through the first set, in which he was broken three times, the normally defensive-minded Simon took it to this vulnerable version of Federer. He won the third set going away, 6-2.

But this was three-of-five, and Federer had one more chance to turn it around. He steadied himself early in the fourth and found enough confidence to take over the rallies again. In hindsight, the period of fear ended with Simon serving at 2-3 in that set. On his first break point, Federer, letting out a rare grunt after each stroke, curled a forehand up the line to go up 4-2.

After that, it didn’t take long for Federer to get all of his confidence back, and he went on his own seven-game winning streak. Through the end of the fourth set and start of the fifth, it was old-fashioned full flight Federer; he showed off a little of everything in his artistic arsenal. He reflexed a short-hop forehand past Simon at the net in the final game of the fourth. He carved under a backhand drop volley for a winner in the first game of the fifth. Up 3-0 and seemingly cruising, he hit a drop shot off a second-serve return and followed it up with a volley-lob over Simon’s head for a humiliating winner. Was it toy time?

Not quite. Simon held his next three service games, forced Federer to serve it out at 5-3, and, with the fickle French crowd back on his side, earned two break points. Federer wasn’t cruising now; he was tight. He hit his ground strokes short, dumped two regulation volleys into the net, and, on his first match point, went for a puzzlingly low-percentage forehand down the line and drilled it into the net. But if the rest of his game was deserting him, Federer still had his serve. At 15-30, he hit an ace. On his first break point, he hit a service winner. On his second, he hit another excellent first serve that led to a smash winner. Finally, on his second match point, Federer watched as Simon went for broke on a backhand down the line and missed.

Federer had survived, 6-1, 4-6, 2-6, 6-2, 6-3, and extended his Grand Slam quarterfinal streak to a record 36. He was in control of the action for most of the day. Sometimes this was for good—he hit 60 winners—and other times it was for bad—he committed 56 errors. On the minus side, Federer suffered a protracted dip in play after his ankle roll, and he got nervy trying to close it out; there were a few moments in the final game when the possibility of Federer losing another match after holding match points darted through my head. On the plus side, though, he recovered to full strength after that mid-match collapse, seemed to show no signs of injury, and did what he had to do to close it out—even when, for once, the Paris crowd wasn't howling his name. You don’t reach the quarterfinals or better at every Grand Slam for nine years without knowing how to shake things off and close.

Now that he’s in the quarters, of course, things aren’t going to get easier. Federer will have another, better, more popular French player, Jo-Wilfried Tsonga, to contend with next. He’ll need all of his confidence, for every one of the sets, in that one.