Madrid Masters: Andy Murray sees off Gilles Simon to earn a quarter-final meeting with Tomas Berdych It was hard not to feel sorry for Gilles Simon. The Frenchman, having lost his 10 previous matches against Andy Murray, appeared to be heading for victory when he led by a set and a break in the third round of the Madrid Masters tonight, only for his opponent to turn the contest on its head and earn a quarter-final meeting tomorrow evening with Tomas Berdych. Murray, who had learned earlier in the day that he would return to No 2 in the world rankings thanks to Roger Federer's defeat by Japan's Kei Nishikori, won 2-6, 6-4, 7-6 after nearly three hours to keep alive his hopes of reaching his first clay-court final. Following Novak Djokovic's defeat by Grigor Dimitrov, who in turn went out of the tournament when he lost to Stanislas Wawrinka, Murray is the highest-ranked player left in the top half of the draw. Thoughts of Murray making any further progress were, however, far from anyone's mind as Simon won eight of the first 10 games. The world No 17 played well enough, but many points were presented to him on a plate as a strangely lacklustre Murray, who again appeared to have a hip problem, played too cautiously and allowed the Frenchman to dominate. When Simon led 2-0 in the second set it was hard to see how Murray would find a way back, but from 0-30 down in the following game he dug deep to hold serve. The fourth game of the set proved pivotal. It lasted nearly 14 minutes before Murray finally converted a break point at the eighth attempt with a thumping backhand return. With Murray at last upping his tempo and playing with more belief, the Scot started to dominate the rallies. Simon saved four set points when he served at 4-5, but on the fifth, with the clock approaching midnight, he put an easy forehand in the net. The final set became a late-night thriller. Murray went 3-0 up before Simon, to his great credit, rallied to level at 3-3. The Frenchman saved three match points when he served at 5-6 and two more in the tie-break. When he served at 6-7, however, Simon netted what should have been a routine volley to give Murray victory. Berdych, Murray's quarter-final opponent, has won both his previous meetings with the Scot on clay. The winner will play Wawrinka or Jo-Wilfried Tsonga in the semi-finals. Whatever he achieves this week, Murray will return to No 2 in the world rankings on Monday after Federer's attempt to retain the title was ended by Nishikori. Federer had to win the tournament in order to stay ahead of Murray, but was beaten 6-4, 1-6, 6-2 as Nishikori enjoyed one of the best wins of his career. The world No 16 now faces Spain's Pablo Andujar. Federer, who was playing his first tournament for two months and his first on clay this year, is in danger of going into the French Open, which starts in just 16 days' time, without enough matches under his belt. Next week's Rome Masters is his last tournament before Roland Garros. Murray reached No 2 in the rankings list on two previous occasions but did not remain there for long. His first stay lasted only four weeks in 2009 and his second just three weeks earlier this year. Federer had been on course for a semi-final meeting with Rafael Nadal, who reached the last eight with an emphatic 6-2, 6-3 victory over Russia's Mikhail Youzhny. Nadal, who now faces his fellow Spaniard David Ferrer, improved noticeably on his opening victory over Benoit Paire. Serena Williams, who is defending the women's title, needed just 64 minutes to beat Russia's Maria Kirilenko 6-3, 6-1 and secure a quarter-final meeting with Spain's Anabel Medina Garrigues. "I just felt really relaxed today," Williams said afterwards. I felt like I was just taking my time. Maria Sharapova joined Williams in the last eight but faced a tough challenge from Germany's Sabine Lisicki before winning 6-2, 7-5. Sharapova now faces Kaia Kanepi, who beat Daniela Hantuchova 6-3, 6-4.