* Williams to meet Errani in semi-finals
* Sharapova into last four for first time
World number one 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 quarter-finals on Friday.
The defending champion at the clay event fought back from 4-2 down in the third set to see off the local favourite, 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 number two Maria Sharapova comfortably booked her semi-final berth beating unseeded Estonian Kaia Kanepi 6-2 6-4.
"It was definitely a battle," Williams told a news conference after her match with Medina Garrigues.
"I obviously didn't do much in the second set and I think I gave her a lot confidence to play better. I thought she played really well in the third."
Williams made it 26 wins and only one defeat since the start of last year's claycourt season, but was up against an experienced player on the surface.
The 30-year-old Spaniard has the highest number of clay-court title wins with 10 among active players and stunned the American by taking the second set to love.
"I wasn't really there," Williams said. "I wasn't really in it. My feet weren't moving. I don't know what happened.
"To turn it around I got up earlier on the changeover and started doing high knees and just stretching and doing anything to try to get my intensity back up where it needed to be.
"I definitely want to cut back on my unforced errors. I had a lot today. Also, I went for a lot more today than I have been doing in my past few matches.
"So I think I'm going to go back to the way I have been playing, and being more calm, and not making as many errors as I did today."
French Open champion Sharapova qualified for the semis for the first time in four appearances in Madrid, and will meet either sixth seeded German Angelique Kerber or 16th seeded Serbian Ana Ivanovic in the next round.
"I was just happy to get past the quarter-finals, I feel like I've been stuck in this tournament," the Russian said.
"I faced her at the French Open where she had really good wins last year, so I know that she's capable," Sharapova added of Kanepi who reached the quarter-finals at Roland Garros last year.
"So I was just really determined. I'm happy that I was able to win with that type of scoreline."