Serena Williams staged a recovery at the expense of Caroline Wozniacki as the American reached the quarter-finals of the Madrid Masters 1-6, 6-3, 6-2 on Thursday in a battle of former number one players. 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. 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. The Dane had been bidding for a sixth quarter-final of the season. Wozniacki, who won joint WTA-leading six titles in 2011 is still searching for her first of 2012. Williams has now won ten straight matches and has claimed the last six when facing Sharapova, the world number two and recent Stuttgart champion. 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.