World number one Rafael Nadal fought back to beat Lukas Rosol and avoid a repeat of his shock Wimbledon defeat by the unseeded Czech two years ago.
Rosol, ranked 52nd, had a set point for a two-set lead, but two-time champion Nadal recovered brilliantly to come through 4-6 7-6 (8-6) 6-4 6-4.
The Spaniard, seeded second, goes on to face Mikhail Kukushkin of Kazakhstan in the last 32 on Saturday.
It is the first time since 2011 that Nadal has reached the third round.
"I knew I had to keep fighting, waiting for my moment," Nadal told BBC Sport.
"I made a few mistakes but he was serving very well, then the second set was very important. Against Rosol, two sets down, it would have been very dangerous."
If Rosol's second-round victory over Nadal in 2012 was one of the greatest upsets in tennis history, repeating the effort seemed even more unlikely. Yet the Czech went closer than anyone could have expected.
Once again, the 28-year-old found a rich seam of heavy serving and thunderous groundstrokes that left Nadal helpless and facing a two-set deficit.
After breaking at 4-4 on his way to taking the first set, Rosol moved 4-2 clear in the second as the winners flew off his racquet behind an impenetrable serve.
Nadal looked forlorn and his coach and uncle, Toni, stood and urged on his nephew from the players' box.
Finally, Rosol gave the 14-time Grand Slam champion some breathing space as the Czech's first serve faltered and Nadal took advantage with some fine returning to get back on level terms and force the tie-break.
|John McEnroe on Nadal's win|
|"How do you teach will, desire, not to quit in any circumstances? you don't see this often, once every 10 years if you're lucky. Nadal has made other guys better trying to compete with him. In the definition of 'where there's a will there's a way' he's the picture you're going to see."|
Another surge of adrenaline saw Rosol hammer a forehand to edge 5-3 ahead, but with two serves for a two-set lead Nadal pegged him back with a low slice, and facing set point the Spaniard backed up his serve with a trademark forehand winner.
Rosol had won just two Grand Slam matches since his 2012 win over Nadal, and the difference in big-match experience suddenly came to the fore.
Nadal was now the one up on his toes and Rosol on the defensive, double-faulting when facing set point and fading further as the pressure only grew from his opponent.
The Czech fought off three break points before netting a forehand to drop serve early in the fourth, and Nadal moved confidently towards the finish line before one late scare.
Rosol remained a threat and a mistimed forehand from the Spaniard at 30-30 when serving for the match offered up one last sliver of hope, but Nadal responded with a forehand winner before converting his second match point.
"I never play for revenge, every match is a different match," added Nadal. "Today was another match I tried to win.
"It's a great win for me. It's the best level I played on grass since a long time ago, the last three sets. That's very important news for me."
Rosol said: "I was not thinking if I can do it again, if I can not do it again. I was trying to just play my game, concentrate every single point, and from the beginning was pretty good, everything was working.
"Third and fourth sets I was really struggling on my serve. Not many first serves in. Without serve then we start to play rallies, and that was his game."