World number one Rafael Nadal came from behind to book his place in the next stage, overcoming Czech Lukas Rosol 4-6 7-6 (8-6) 6-4 6-4.
Nadal had been defeated by Rosol at the same stage in 2012 and, after losing the first set this time around, appeared to be on course for the same result.
However, the 14-time grand slam champion showed great spirit to fight back and set up a third-round clash with Kazakh Mikhail Kukushkin, a 6-3 6-3 6-2 winner over Canada's Frank Dancevic.
Federer, a seven-time Wimbledon champion, enjoyed much easier progress, hitting 44 winners in a 6-3 7-5 6-3 over Luxembourg's Gilles Muller.
Australian Open champion Stanislas Wawrinka ensured more Swiss joy with a 7-6 (8-6) 6-3 3-6 7-5 success over Lu Yen-hsun of Chinese Taipei.
Wawrinka saw off a determined challenge from Lu and will now face Denis Istomin following the Uzbek's 7-6 (9-7) 6-4 6-4 win over German Julian Reister.
The main shock of the day came as France's 13th seed Richard Gasquet was beaten 3-6 6-7 (4-7) 6-4 7-5 10-8 by Australian teenager Nick Kyrgios in an epic five-set clash that lasted three hours and 55 minutes.
Wildcard Kyrgios saved nine match points to emerge victorious and book an encounter with Czech Jiri Vesely, who dumped another Frenchman out by earning a 7-6 (7-3) 6-3 6-7 (1-7) 6-7 (3-7) 6-4 victory over Gael Monfils.
Jo-Wilfried Tsonga was able to give French fans something to cheer about as the 14th seed finally dispatched Sam Querrey of the USA 4-6 7-6 (7-2) 6-7 (4-7) 6-3 14-12 in a match held over from Wednesday.
Italy's Simone Bolelli was another unexpected winner, stunning German 22nd seed Philipp Kohlschreiber 4-6 6-4 6-3 2-6 7-5, and will look to do the same against Kei Nishikori of Japan after the 10th seed eased past American Denis Kudla 6-3 6-2 6-1.
The United States' John Isner racked up 32 aces as he won in typically tight fashion against Finland's Jarkko Nieminen, progressing 7-6 (19-17) 7-6 (7-3) 7-5 in a match that featured an enthralling first set tie-break.
Milos Raonic of Canada is also through after a 6-3 6-4 6-4 win against Isner's countryman Jack Sock, but Colombian Santiago Giraldo's clash with Marcel Granollers will resume on Friday with the Spaniard ahead 2-1 in the fifth set.
Poland's Jerzy Janowicz won the first set 7-5 against Australian Lleyton Hewitt, but was then left frustrated as the contest was also postponed at 4-4 in the second due to the inclement weather at the All England Club.
Elsewhere in Thursday's action, there were wins for Tommy Robredo and Lukasz Kubot, while Feliciano Lopez's meeting with Ante Pavic was delayed until Friday because of the rain.