Serena Williams staged a recovery at the expense of Caroline Wozniacki as the American reached the quarter-finals of the Madrid Masters with a 1-6, 6-3, 6-2 win on Thursday in a battle of former world number ones.
The comeback win in 1hr 42min put Williams into a showdown with second seed Maria Sharapova, who earned her last-eight place when opponent Lucie Safarova withdrew before their match with stomach illness.
Williams sleep-walked through the opening set as Denmark's sixth seed had it all her own way in half an hour.
"I had a slow start today, I don't know why," said Williams. "I was sluggish and mentally maybe fighting some demons.
"I started trying to play better, the first set was not me at all. I knew I had to get better. I just tried to play my game."
After trailing a set and 1-2, the momentum suddenly shifted in Williams' favour, with the ninth seed breaking for 3-2 with a backhand down the line and finishing a run of a dozen points in succession to lead 4-2.
Williams, the 2009 runner-up to Dinara Safina, levelled at a set each and ran off with the third to end with four breaks of serve in a disheartening loss for Wozniacki.
Wozniacki had been bidding for a sixth quarter-final of the season but, having won six titles in 2011, she is still searching for her first of 2012.
The Dane rolled her ankle earlier in the week but said that was not a problem in her loss.
"It is feeling better, which is a huge plus. I can take a lot of positives from this match into the French Open," she said.
"I believe in myself, the confidence is there. I can beat anyone on a good day."
Williams has now won ten straight matches and has claimed the last six when facing Sharapova, the world number two and recent Stuttgart champion.
Polish fourth seed Agnieszka Radwanska advanced over Italy's Roberta Vinci 7-6 (7/1), 6-4 while Lucie Hradecka beat Elena Makarova of Russia 6-2, 7-6 (7/5).
In the men's third round on the blue clay of the Caja Magica, Czech sixth seed Tomas Berdych ended the injury comeback effort of Frenchman Gael Monfils, the number 12, with a comprehensive 6-1, 6-1 victory.
Monfils was playing for the first time since a March abdominal muscle problem. The flamboyant French player lost serve five times while never earning a break point against Berdych.