Lopez only temporarily recovered, but Federer hit an ace staring at a match point and eventually prevailed 7-6 (13), 6-7 (1), 7-6 (7) to avoid what would have been a headline-grabbing defeat.
Yes, the knives were being sharpened. Federer had just lost to a second-tier player, Jurgen Melzer, in Monte Carlo before his encounter with Lopez, who, unlike many other Spaniards, does not have a penchant for clay.
And even in triumph, more questions are sure to be asked, specifically whether a declining Federer can pick it up and mount any sort of challenge in Madrid, and more importantly, at the French Open, which is fast approaching.
But let's not read too much into Wednesday's thriller at the appropriately named "Magic Box."
For one, the high-altitude courts in Madrid play fast. More than a few pros have said as much this week.
Look at the numbers Lopez and Federer put up on serve -- a combined 48 aces. No misprint, that's 48 aces on a clay court, more than Federer and Gael Monfils hit when they played three tiebreaker sets -- indoors -- at the Paris Masters last fall.
One might argue that in slicker settings Federer should still handle Lopez comfortably, but the Spaniard owns one of the best serves, when it's working, in the men's game, and he took advantage of the conditions to give Federer problems.
Federer was 7-0 heading into the encounter, we hear you saying. Five of those seven tussles were tight, though, including their clash at the 2007 U.S. Open, when the Swiss was at the height of his powers. He found a way to get through it, as he did Wednesday.
Lopez benefited from playing at home, just as Monfils did in Paris when he upended Federer, and the former is having his best clay-court season to date. He extended Djokovic, Mr. Perfect, at least in 2011, to a first-set tiebreaker in Sunday's final of the Belgrade Open on the Serb's home turf. He was arguably the better player in their first set, crucially unable to capitalize on his break-point chances.
In short, this was no cream-puff draw for Federer.
Even if he did lose, falling in his opener at a Masters event isn't all that new for the 16-time Grand Slam champ. Every year since 2007 it's happened: in Cincinnati, Indian Wells, Toronto, Paris and Rome. This wouldn't have been new territory.
Federer won't be tested nearly as much in his third-round match Thursday against pal Xavier Malisse. Malisse's serve won't trouble Federer, so expect a few breaks and progression in straight sets.
If Federer gets Soderling, the conditions would benefit him more than the Swede. Reaching the semis and meeting Rafa, would probably be a job well done for Federer in Madrid -- no matter the result.
There's no need to panic. Save that for when Federer begins losing prior to the quarterfinals at majors.
London-based Ravi Ubha covers soccer and tennis for ESPN.com. You can follow him on Twitter.