Russian star Sharapova, the 2008 champion, came through a brutal three-set marathon against 44th ranked Karin Knapp in intense heat.
She battled temperatures of up to 42 Celsius (107.6 Fahrenheit) and a third set lasting nearly two hours to down the Italian 6-3, 4-6, 10-8 and set up a clash with France's Alize Cornet, who broke down in tears of frustration during her game.
"I worked really hard in the last few months and I wanted this match," said Sharapova after making extensive use of ice vests and ice packs to keep cool in the sizzling conditions.
"I didn't play my best tennis; I didn't do many things well. But I got through it, and sometimes that's what's important."
It wasn't easy for the 26-year-old, who is coming back from surgery and is desperate to win a fifth Grand Slam with her last coming at the French Open in 2012.
Her serve let her down and she only converted seven of 20 break points against a gritty opponent who refused to give up.