The No. 2-ranked Sharapova had a narrow escape with a 6-1, 4-6, 7-5 second-round win over fellow Russian Alexandra Panova, a qualifier ranked No. 150.
Sharapova made 51 unforced errors as she went for the lines, but she kept swinging hard and saved some of her best ground strokes for when she needed them most.
She faced two match points in the 10th game of the third set, stepping into a return winner on a weak second serve and later ripping a forehand winner deep into the corner against Panova, a qualifier who entered the Australian Open without a single match win at five previous majors.
"I'm just happy to get through -- I was one point away twice today from being out of the tournament," said Sharapova, who started the season by winning the Brisbane International title. "I was not playing my best tennis today.
"I think she played a pretty inspired match. She came out here with not much to lose and swinging freely and going for her shots."
Sharapova, who won the 2008 Australian Open and has five Grand Slam titles, struggled with her serve in the second and third sets as the match extended to 2 hours, 32 minutes in temperatures topping 91 degrees.
She raised her intensity in the final set, screeching loudly as she fought to control rallies and clenching her left fist as she prepared to receive. She is the only Grand Slam champion remaining in her half of the draw and next plays No. 31 Zarina Diyas, who beat Anna Schmiedlova 3-6, 6-2, 8-6.
Said boyfriend Grigor Dimitrov, the No. 10 seed in the men's draw: "Days like that define who you are."
Eugenie Bouchard's strong record in Grand Slam tournaments continued as she beat Kiki Bertens of the Netherlands 6-0, 6-3 to advance to the third round.
The seventh-seeded Bouchard won the match in 54 minutes.
Two of Bertens' three game wins came on breaks of Bouchard's serve, including when the Canadian was first serving for the match.
After advancing to the semifinals last year in her first appearance at Melbourne Park, Bouchard improved to 7-1 in Australia. The losing finalist at last year's Wimbledon tournament, Bouchard has 25 wins and seven losses in majors. She is playing in just her eighth Grand Slam event.
In earlier second-round matches, No. 10 Ekaterina Makarova beat Roberta Vinci 6-2, 6-4; No. 21 Peng Shuai had a 6-1, 6-1 win over Magdalena Rybarikova;No. 22 Karolina Pliskova beat Oceane Dodin 7-5, 5-7, 6-4; and Carina Witthoeft defeated Christina McHale 6-3, 6-0.
Doubles play opened Wednesday, without some regular starters. Serenaand Venus Williams withdrew from their first-round doubles match, but tournament officials did not immediately specify a reason. Both of the sisters have second-round singles matches Thursday.
The Associated Press contributed to this report.
Sharapova Survives Three-Set Scare
Maria Sharapova saved two match points in the third set, topping Alexandra Panova 6-1, 4-6, 7-5 to advance to the third round at the Australian Open.
Sharapova Talks Second-Round Win
Maria Sharapova talked about her tough, three-set win over Alexandra Panova to reach the third round at the Australian Open.