Safarova came away a 4-6, 6-4, 7-6 (7-3) win over the second-seeded Wozniacki, who was playing her first match since dropping out of the world No. 1 ranking.
Each player saved eight of the 10 break points they faced and were 3-of-4 in saves in the third set. But Safarova had the more solid service game, winning 71 percent of the points on serve, including 69 percent in the third set.
Top-seeded Victoria Azarenka, who replaced Wozniacki at the top of the rankings, was very sharp in her match Wednesday. She had six breaks in a 6-1, 6-0 win over Mona Barthel that took 60 minutes. Azarenka took 70 percent of the points off Barthel's serve.
Seeded players went 5-7 in the second round even with No. 3-seeded Samantha Stosur getting a 6-4, 7-6 (7-5) win over Sorana Cirstea in the 16th match of the day.
Fourth-seeded Agnieszka Radwanska stopped Anne Keothavong 6-1, 6-2 while No. 5-seeded Marion Bartoli routed Anabel Medina Garrigues 6-2, 6-0 and 14th-seeded Svetlana Kuznetsova swept by Maria Kirilenko 6-4, 6-4.
But Monica Niculescu advanced when No. 6-seeded Vera Zvonareva, down 6-5, 3-2, retired; Yanina Wickmayer eliminated seventh-seeded Francesca Schiavone 7-6 (7-4), 6-4; and Shahar Peer beat eighth-seeded Jelena Jankovic 7-6 (7-3), 6-2.
Also Christina McHale stopped 12th-seeded Peng Shuai, Petra Cetkovska beat No. 14 Ana Ivanovic 6-4, 6-4, and qualifier Varvara Lepchenko edged 16th-seeded Julia Georges.
Other seeded players advancing to the third round Wednesday were Simona Halep, Ksenia Pervak, Kateryna Bondarenko and Tsvetana Pironkova.
Video of Victoria’s Secret models trying to 'twerk' hits Instagram
Megyn Kelly: Santa Claus and Jesus are both white men