Andy Murray made a nervous start to his Madrid Open campaign with an unconvincing 6-4 3-6 6-0 second-round victory over Gilles Simon.
The British number one, playing his first match in over two weeks after an elbow injury, struggled for consistency despite taking the first set.
His forehand unravelled in the second set as Simon pounced on the mistakes.
But he regained confidence in the decider to set up a third-round match against Brazilian Thomaz Bellucci.
After the match, Murray said: "Obviously the third set was good, I came through a lot of long games.
"I thought I served well for most of the match, ground strokes were a bit up and down, and I volleyed pretty well when I came in.
"It's obviously different conditions here," added Murray, referring to the high altitude in Madrid.
"I wasn't timing the ball that well from the back of the court and that's something that hopefully after getting through a tough one today I'll do better on Thursday."
While the third-set demolition looked impressive, Murray's back-room team will be particularly concerned by the numerous unforced errors throughout the opening two sets on the Arantxa Sanchez Vicario Court.
Murray had been given a first-round bye as the fourth seed and his 18-day injury absence from the clay courts, which forced him to miss last month's Barcelona Open, was clearly apparent.
And Simon, ranked 20th in the world, took advantage of a number of uncharacteristic mistakes by the Scot.
"The tennis wasn't great, he's a very difficult player to play against," said a relieved Murray, who won the Madrid title in 2008 when it was played on hard courts rather than clay.
"The ball's flying around at the altitude, his balls were shooting through. I didn't get into a rhythm but I was serving well at the end. I can definitely play a lot better."
Despite breaking his opponent in the first game of the match, Murray's groundstrokes failed to find their intended range, allowing Simon to counter-attack and use his powerful forehand with a series of clean winners.
Murray was stretched to the limit as Simon probed for a break in the eighth game. But Murray held and then sealed a decisive break to lead 5-4, staying in crucial rally with a brilliant defensive lob at full stretch before finishing off the point with a drive volley.
The Scot's drop-shots - which lacked conviction in the early stages of the set - began to find their range as Simon slammed a return into the net to hand the first set to Murray.
His first service game of the second set was impressive, won to love, but continuing problems on the forehand side frustrated the world number four, with Simon capitalising on anything short.
A flurry of unforced Murray errors - met with a series of on-court expletives - handed Simon the opportunity to break and he served out for the second set.
After Murray took the first game of the third set, former world number six Simon went 40-0 down on his own serve and the Scot broke at the third attempt for a crucial 2-0 lead.
A significant improvement in his service games allowed Murray to dictate the tempo of the third set, although Simon was in belligerent mood, forcing his opponent to defend a number of break points.
However, Murray extended his record to six victories in seven against Simon as he served out for a hard-fought victory.
Bellucci booked his third-round place when German Florian Mayer was forced to retire with an injury in the third set of their match.
"I actually don't know that much about him," Murray said of the Brazilian. "I watch a lot of tennis, I just haven't really seen that play that much.
"I know he's a lefty, I know he's got a double-handed backhand, I know clay is probably his best surface.
"Dani (Vallverdu, hitting partner) went to watch his match against Mayer and will have seen some things there that will help me but I've never practised with him or played against him."