Andy Murray was pushed all the way as he kicked off his Madrid Open title defence on Tuesday, the 2015 winner eventually seeing off a spirited display from Radek Stepanek.
After allowing a one-set lead to slip, Murray finally broke the rhythm of his experienced opponent in the decider to progress to round three 7-6 (7-3) 3-6 6-1.
Murray was sluggish out of the blocks and Stepanek made him pay, the veteran on the offensive from the outset and executing some sublime passing shots.
However, a missed chance at an early double break gave Murray a glimmer of hope and he duly accepted it, this time the second seed executing pinpoint groundstrokes to decide gripping rallies.
More athleticism from Murray in the tie-break proved the difference, the Briton moving ahead with the aid of a backhand lob that Stepanek was unable to return.
The Czech quickly put that behind him, though, with another stunning start to a set, Stepanek this time succeeding in opening up a 3-0 lead with intensity Murray could not match.
Stepanek's composure at the net was particularly impressive as the defending champion began to lose his cool, the second set going to the qualifier.
In stark contrast to the opening two sets, it was Murray who started better in the decider with a newfound determination evident in his play.
As the two-time grand slam winner upped the tempo, the first two sets seemed to catch up with his 37-year-old opponent, Murray booking a third-round meeting with Pablo Carreno-Busta or Gilles Simon.