WIMBLEDON, England -- Roger Federer overcame a two-set deficit Friday at Wimbledon to avoid his earliest Grand Slam exit since 2004.
The six-time champion found himself two points from defeat on six occasions but survived a tense fourth-set tiebreaker and beat Julien Benneteau in the third round, 4-6, 6-7 (3), 6-2, 7-6 (6), 6-1.
"It was a tough match," Federer said. "Oh my God, it was brutal. Obviously, a bit of luck, maybe, on my side. Who knows? But I tried hard. I fought 'til the very end."
Federer avoided the fate that befell nemesis Rafael Nadal 24 hours earlier on the same Centre Court. Nadal, a two-time champion, made his quickest exit from a major since 2005 when No. 100-ranked Lukas Rosol beat him in five sets Thursday.
Benneteau had won his past four five-set matches, but this time he was the wearier player at the end, twice requiring thigh massages from a trainer for cramps during the fifth set. Federer cracked a forehand return winner into the corner to break for a 3-1 lead and pulled away from there.
A hobbling Benneteau appeared in tears before the final point, and he dumped his last shot in the net. Fans roared as a grinning Federer gave them a triumphant wave.
"Mentally, he's a rock," Benneteau said. "He's two sets down, and he doesn't show anything."
Federer also erased a two-set deficit to beat Juan Martin del Potro in this month's quarterfinals at the French Open. He has mounted eight comebacks from down 0-2 in his career.
"The thing, when you're down two sets to love, is to stay calm, even though it's hard, because people are freaking out, people are worried for you," Federer said. "You don't have, obviously, many lives left out there. You just try to play tough and focus point for point. Sounds so boring, but it's the right thing to do out there."
The No. 3-seeded Federer seeks to match Pete Sampras' modern record of seven Wimbledon championships. He has been stalled for 2½ years at a record 16 Grand Slam titles, but Nadal's departure improves his chances next week.
Federer has reached at least the quarterfinals at a record 32 consecutive major tournaments.
When a drizzle delayed the start of the third round, tournament officials decided Djokovic's match should be played inside. An odd spectacle ensued: The roof closed as the sun came out and outside court covers came off.
"I was a little bit surprised, when I saw sunshine, that the roof is closed," the defending champion said. "Obviously they're relying on a forecast that I don't think is very reliable here. But OK."
Djokovic missed opportunities to seize an early lead, failing to convert his first five break-point chances before he lost serve at love to drop the opening set. But he dominated from there, breaking in the first game in each of the final three sets.
Because of the daylong rain threat, Federer's match was played with the roof closed. The No. 29-seeded Benneteau broke in the ninth game to seize the lead, and rallied from a break down in the second set, taking advantage of a blown overhead by Federer on a key point to reach 4-all.
In the next game, Benneteau cracked a return winner, and the Frenchman shouted, "Allez!"
Federer, who speaks six languages, responded with a service winner and also hollered, "Allez!"
Benneteau wobbled serving at 5-6 in the second set, double-faulting twice and blowing an overhead. The score went to deuce seven times, but he managed to hold with the help of several big serves.
"He played so well," Federer said. "He was making me doubt, obviously, for most of the match. That's a credit to him. He played amazing, I thought."
Benneteau whacked two aces in the tiebreaker, and at that point nothing seemed to be going Federer's way. He even went 0-for-4 in the set requesting relay reviews.
The comeback began quickly, with Federer racing to a 4-love lead in the third set, but the fourth set was more difficult. Benneteau was two points from an upset for the sixth and final time at 6-all in the tiebreaker, but he hit a backhand long and a forehand into the net.
Federer skipped to his chair, relieved to be still in contention at Wimbledon.
American Sam Querrey hit the last of his 21 aces on match point and beat No. 21-seeded Milos Raonic, 6-7 (3), 7-6 (7), 7-6 (8), 6-4. That second-round match had been suspended in the third set Thursday because of rain.
Djokovic has the weekend off and said he might squeeze in a round of golf. His fourth-round opponent will be 34th-ranked Viktor Troicki in an all-Serbian match. Troicki beat No. 15-seeded Juan Monaco 7-5, 7-5, 6-3.
Djokovic's slow start briefly stirred speculation about another upset on the heels of Nadal's.
"I was a set down but managed to make the crucial break in the opening game of the second set," Djokovic said. "And then I thought I played really well."
Stepanek, at 33 the oldest man left in the tournament, repeatedly played serve-and-volley and had Djokovic on his heels in the early going. Djokovic hit an improbable winner that skipped off the top of the net post and still lost the first set.
Then the match quickly swung his way, and the 28th-seeded Stepanek couldn't compete with Djokovic's mistake-free play. The Serb committed just 13 unforced errors in 221 points.
The match remained entertaining even as it became lopsided. One game in the final set lasted 26 points and had Djokovic smiling at Stepanek's unconventional style, which included a belly flop in pursuit of a shot.
"The fourth set from Novak's side was very impressive," Stepanek said. "I was battling until the end, but the fourth set I felt like no matter what I do on the court, he always answers."
The victory made it two in row under the roof for Djokovic.
"I thought I played great," he said. "But, look, this is an outdoor tournament, so I think everybody wants to play when the roof is open."
The half of the men's draw opposite Djokovic opened up when Nadal lost.
Nadal had reached the past five Grand Slam finals and won his seventh French Open title this month. He also had reached the final in his past five Wimbledons, winning the title in 2008 and 2010.
His departure creates an opportunity for three-time Wimbledon finalist Andy Roddick and Andy Murray, who seeks to become the tournament's first British champion since 1936. Both are on Nadal's side of the draw.
Information from The Associated Press was used in this report.