Andy Murray finally reached the quarter-final of the Mutua Madrid Open after he broke the dogged resistance of Frenchman Gilles Simon in a match lasting almost three hours.

Murray lost the first set 6-2 but hit back to level the match by winning the second 6-4 and it seemed that victory was inevitable when he took a 3-0 lead in the third set.

However, the world number 17 consistently clawed his way back when he appeared on the brink of defeat and eventually the match went to a tie-break before the Scot won 2-6 6-4 7-6 (8/6).

It was a sapping match lasting just four minutes shy of three hours and left the Murray, who will return to number two in the world after Roger Federer's surprise defeat, little time to recover before his last-eight match tonight with Tomas Berdych.

Murray was broken in the first game of the match, as a weak lob was put away convincingly by Simon to set up break point and Murray then sent a backhand wide.

The Scot had his first chance to level matters in the sixth game, with a break point against a second serve, but sent a backhand long and slipped 4-2 behind.

An ill-judged leave put him 15-30 down in his next service game and he was broken for a second time, leaving Simon serving for the set.

And though he twice fell behind in the game, the Frenchman pulled through to take the set 6-2 in 37 minutes.

Simon had dominated the longer rallies, with Murray attempting to counter by stepping some two yards inside the baseline on second serve.

Simon repeated his flying start in the second set, a lengthy first game ending with a superb swinging smash down the line to break.

But Murray's aggressive approach against the second serve finally paid dividends as a deep return allowed him to level at 2-2, with his seventh break point in a game lasting well over 10 minutes.

Murray trailed 15-30 while serving at 4-4, but responded with a big second serve, a thumping smash and a superb dipping cross-court forehand to win three successive points and take the game.

He allowed four set points to slip away but a big double-fault from Simon, clearly flustered by his opponent again advancing, set up a fifth and Murray finally took the set 6-4.

Following the second set the court was doused with water prompting bewilderment from Simon.

However, it had no affect on Murray who held serve to love before breaking his opponent with superb cross-court shots that Simon could do nothing about.

The Scot clearly had the bit between his teeth and again held for love for 3-0 as he appeared to show Simon a clear pair of heels.

The Frenchman, however, rallied and completely unexpectedly hauled himself back to 3-3.

The match then went with serve with Murray moving to 5-4 and Simon forced to serve to stay in the match.

The Frenchman's touch at times deserted him and he had a number of reprieves before holding for 5-5.

Murray held and then a ferocious forehand saw him claim double match point, neither of which he could convert, and a smash saw Simon hold to send the match into a tie-break.

Some sublime play from Murray, including an audacious drop shot which went inches into his opponent's court, saw him to a 4-1 lead.

Simon though would not give up and he clawed his way back to 4-4 and although Murray claimed two more match points, his rival would not let go and again they were level at 6-6.

Murray moved to match point at 7-6 and finally prevailed, Simon hitting the ball into the net as the pair were greeted with rapturous applause.

Murray admitted he could have been more clinical and finished the match earlier in the deciding set but pointed to the battling nature of Simon.

He told Sky Sports 4: "It's very different playing in the evening, the ball doesn't bounce particularly high.

"He was taking my time away and hitting close to the lines and making it very difficult.

"I managed to turn it around.

"I probably could have finished the third a bit quicker if I had taken some of my chances but he fought."

Of his last-eight clash with Berdych, Murray said: "I am just going to focus on recovering properly.

"By the time I am in bed it will be about 3.30, 4am so I need to focus on that and then worry about the match tomorrow night."