Madrid - While most of the top seeded men won without problems, Roger Federer had to come through a huge battle to wear down Feliciano Lopez 7-6 (15/13), 6-7 (1/7), 7-6 (9/7), taking nearly three hours and firing 25 aces outside a Grand Slam event for the first time in his career.
"I'm relieved to get through," said the Swiss, who has only hours to recover for a meeting with Xavier Malisse. "It was not easy at all.
"But it all came together for me in the end nicely. It didn't feel like a clay match, it was bang-bang. I was playing OK. It got more and more diffciult to return his serve.
"It was a tough match. I guess it will help me for the French Open, I did spend three hours on clay."
Federer took 70 minutes and nine set points to win the opening set only to see his long-time rival Lopez claw back in the second.
The third was a lottery, with Federer finally prevailing on a second match point as Lopez returned long.
Earlier, top-seeded holder Rafael Nadal won a 35th consecutive clay match, dispatching Marcos Baghdatis 6-1, 6-3 in just under 90 minutes.
Nadal has not lost on clay since 2009, in the French Open fourth round to Robin Soderling.
"I played well, it was a solid match with not many mistakes," said the Spanish world number one. "It was very positive to beat an opponent against whom I last lost (in August 2010 in Cincinnati)."
Nadal faces a high-voltage third-round showdown with Argentine Juan Del Potro, who thrashed Marin Cilic 6-3, 6-0 after complaining of hip pain a day earlier.
"I will need all of the crowd support when I play Del Potro," said Nadal. "The winner of this match will get confidence for the rest of the tournament."
Novak Djokovic also kept his 2011 winning streak alive as he claimed his 28th straight victory of 2011 with a 6-3, 6-4 defeat of South African Kevin Anderson.
He will next face Spain's Guillermo Garcia Lopez as he tries to equal the 29-0 season start of Ivan Lendl, achieved in 1986.
Djokovic's victory tally now stands at 30 consecutive matches, as his two Davis Cup finals wins are also counted.Two-time Roland Garros finalist Soderling followed number four seed Andy Murray into the third round.
Fifth seed Soderling beat Colombia's Santiago Giraldo 6-3, 6-3, while Murray struggled but got past Gilles Simon of France 6-4, 3-6, 6-0, taking almost two and a half hours.
In the women's event, China's Li Na defeated Czech Iveta Benesova 6-1, 6-4 to set up a match with Italian Roberta Vinci, who beat Russian Alisa Kleybanova 6-2, 6-2.
Li secured her win in 58 minutes with five aces and three breaks of serve.
In the third round, Czech 16th seed Petra Kvitova upset second-seeded Russian Vera Zvonareva 6-1, 6-4 to earn the first of the quarter-final spots.
Results on the fifth day of the ATP/WTA Madrid Masters (x denotes seeding):
Andy Murray (GBR x4) bt Gilles Simon (FRA) 6-4, 3-6, 6-0
Daniel Gimeno-Traver (ESP) bt Jurgen Melzer (AUT x8) 7-6 (10/8), 6-3
Roger Federer (SUI x3) bt Feliciano Lopez (ESP) 7-6 (15/13), 6-7 (1/7), 7-6 (9/7)
Juan Del Potro (ARG) bt Marin Cilic (CRO) 6-3, 6-0
Xavier Malisse (BEL) bt Lu Yen-Hsun (TPE) 6-2, 6-2
Rafael Nadal (ESP x1) bt Marcos Baghdatis (CYP) 6-1, 6-3
Robin Soderling (SWE x5) bt Santiago Giraldo (COL) 6-3, 6-3
Novak Djokovic (SRB x2) bt Kevin Anderson (RSA) 6-3, 6-4
Tomas Berdych (CZE x7) bt Marcel Granollers (ESP) 6-4, 6-0
Michael Llodra (FRA) bt Flavio Cipolla (ITA) 6-4, 6-2
Thomaz Belluci (BRA) bt Florian Mayer (GER) 6-7 (5/7), 6-3, 3-0 retired
Li Na (CHN x6) bt Iveta Benesova (CZE) 6-1, 6-4
Roberta Vinci (ITA) bt Alisa Kleybanova (RUS) 6-2, 6-2
Julia Goerges (GER) bt Dinara Safina (RUS) 6-4, 4-6, 6-4
Lucie Safarova (CZE) bt Jelena Jankovic (SRB x7) 6-4, 4-6, 7-5
Petra Kvitova (CZE x16) bt Vera Zvonareva (RUS x2) 6-1, 6-4