Rafael Nadal was one point away from falling behind by two sets before rallying to beat Lukas Rosol, the Czech player who knocked him out at Wimbledon in the same round and on the same court two years ago.
The top-ranked Nadal, a two-time Wimbledon champion, raised his game just in time to avoid falling into a deep hole, rallying for a 4-6, 7-6, 6-4, 6-4 victory on Centre Court to advance to the third round.
In another match, Roger Federer erased memories of his second-round exit last year by beating qualifier Gilles Muller 6-3, 7-5, 6-3 to reach the third round.
The seven-time Wimbledon champion had 25 aces - including three in the final game - in a match that finished under the roof on Centre Court because of rain that forced suspension of play at the All England Club.
Federer lost at the same stage here last year to Sergiy Stakhovsky.
Elsewhere, Gael Monfils made another early exit at Wimbledon, losing 7-6, 6-3, 6-7, 6-7, 6-4 to Jiri Vesely in the second round of the grass-court Grand Slam.
The 24th-seeded Monfils, who reached the quarterfinals at the French Open earlier this month, has never advanced past the third round at the All England Club on a surface he struggles with.
Monfils hit 71 winners, including 23 aces, but had trouble returning his opponent's serve.
Vesely, a former junior world number one, is playing at Wimbledon for the first time.
Other results (selected):
Nick Kyrgios beat Richard Gasquet 3-6, 6-7, 6-4 7-5 10-8
Simone Bolelli beat Philipp Kohlschreiber 4-6, 6-4, 6-3, 2-6, 7-5
Milos Raonic beat Jack Sock 6-3, 6-4, 6-4
Kei Nishikori beat Denis Kudla 6-3, 6-2, 6-1