MADRID — Rafa Nadal recovered from accidentally striking himself in the face with his racket to see off Spanish compatriot David Ferrer 4-6, 7-6, 6-0 in the Madrid Open quarterfinals Friday. World No. 4 Ferrer, ranked one place above Nadal following the Majorcan's seven-month layoff with a knee injury, showed why he is considered one of the most tenacious competitors on the circuit to take the first set of the last-eight clash at the clay Masters event. Nadal clung on to edge the second-set tiebreak 7-3 and then switched up a gear in the decider to set up a semifinal meeting Saturday against Japanese 14th seed Kei Nishikori or Spanish wildcard Pablo Andujar. Nadal had a scare when leading 4-0 in the third set when his racket bounced up off the court as he was stretching down to play a shot and struck him above the eye. After a brief interruption he was able to continue and closed out the victory on his first match point when he broke Ferrer for a seventh time. In Friday's remaining quarterfinals, British third seed Andy Murray meets sixth-seed Czech Tomas Berdych and seventh seed Jo-Wilfried Tsonga of France plays Swiss 15th seed Stanislas Wawrinka. Women's world No. 1 Serena Williams was given her first serious test at this year's Madrid Open as she had to recover from being obliterated in the second set to beat unseeded Spaniard Anabel Medina Garrigues 6-3, 0-6, 7-5 in the quarterfinals. The defending champion at the clay event fought back from 4-2 down in the third set to see off the local favorite, who was cheered on by a partisan crowd at the Magic Box Arena. Williams, who had not dropped a set in her opening three matches, will meet seventh-seed Sara Errani in the last four, after the Italian swept aside unseeded Russian Ekaterina Makarova 6-4, 6-3. On the other side of the draw, world No. 2 Maria Sharapova comfortably booked her semifinal berth beating unseeded Estonian Kaia Kanepi 6-2, 6-4. French Open champion Sharapova qualified for the semis for the first time in four appearances in Madrid, and will meet Ana Ivanovic, who sealed her place in the last four with a 6-3, 6-1 win over sixth seed Angelique Kerber. On Thursday, Andy Murray battled his way into the quarterfinals of the Madrid Masters with a 2-6, 6-4, 7-6 (8-6) victory over 16th seed Gilles Simon in just shy of three hours. The world No. 3 started in the worst possible fashion as he was broken in the opening game and Simon went onto break again as he comfortably took the first set 6-2. Murray seemed to have turned the match around when he took the second, after being down an early break, 6-4 and then surged 3-0 ahead in the third. However, Simon broke back to level at 3-3 and then saved three match points to take the set to a tie-break. The Scot though eventually got the job done with his sixth match point in the tie-break to set up a meeting with Tomas Berdych in the last eight. — Agencies