MADRID — Maria Sharapova avoided an early exit from the Madrid Open Tuesday, rallying to beat Christina McHale to reach the third round. Trailing 4-1 in the final set, Sharapova steadied her erratic service game and took command again to beat the 56th-ranked American 6-1, 4-6, 6-4 on clay at the Magic Box tennis center. The ninth-ranked Russian looked to be cruising before McHale broke late in the second set to tie the match and then took her commanding lead in the final set after breaking Sharapova. However, Sharapova didn't surrender a point after that as McHale netted to be broken to see her advantage dip to 4-3, and Sharapova eventually fired an ace down the middle to eliminate McHale for the second year running. “After a really good start (in Madrid) I didn't keep that level. I think I had a bit of a letdown,” said 2013 finalist Sharapova, who is coming off a tournament victory in Stuttgart. Earlier, Li Na continued her recent dominance of Zheng Jie by easing into the third round 6-2, 6-3 for her fourth straight victory against her fellow Chinese player. Zheng hasn't won a set from the second-ranked Li since her last victory in 2006. Lucie Safarova of the Czech Republic also advanced with a 6-1, 6-2 win over Magdalena Rybarikova of Slovakia, while American Sloane Stephens was also a winner. Fabio Fognini's recent struggles on Spanish clay continued as the 13th-seeded Italian lost 7-5, 4-6, 6-3 to Ukraine's Alexandr Dolgopolov. Fognini failed to get out of the second round at Barcelona last month. Nicolas Almagro will play Andy Murray next after finally dispensing with Andrey Golubev of Kazakhstan, 6-3, 6-7 (9), 7-6 (4) with his 11th match point. Fifth seed David Ferrer also needed three sets to overcome fellow Spaniard Albert Ramos 7-6 (8-6), 5-7, 6-3. Other second round winners included Ernests Gulbis of Latvia, South Africa's Kevin Anderson, Igor Sijsling of the Netherlands, and Juan Monaco of Argentina — who goes on to play defending champion Rafael Nadal Wednesday. On Monday, world No. 5 Simona Halep was in fine form as she thrashed Germany's Julia Goerges 6-2, 6-0. And there were also straight sets wins Caroline Wozniacki and Jelena Jankovic over Ekaterina Makarova and Elina Svitolina respectively. Federer withdraws Roger Federer has pulled out of the Madrid Masters this week as his wife Mirka is due to give birth to the couple's third child. Poland's Lukasc Kubot takes Federer's place to face Gilles Simon of France. Safina to retire Former world No. 1 and Olympic silver medalist Dinara Safina announced Tuesday that she is to retire, Russia's tennis federation press service reported. The report said that the 12 WTA titles winner Safina will participate in the award ceremony of the WTA Madrid Open tournament, where she has won one of her titles in 2009. Safina's farewell ceremony will also take place in Madrid. “Of course I decided to quit much earlier,” the press service quoted Safina as saying. “I decided to withdraw from any official announcements until now as I was still hoping to overcome my back injury. But this moment has finally come. I played the last professional tournament of my career here in Madrid and that's why I think it's the best place for me to quit the game.” — Agencies