In the end, Halep, leaning on experience, won 4-6, 6-4, 15-13, saving three consecutive match points at 10-11 and serving out the match only on her fourth attempt and dancing on a tightrope between catastrophe and champion.
"I'm nearly dead", Halep said in an on-court interview. So long. I never played a third set so long, " she was quoted as saying by the tournament website. "I want to be playing against opponents that are former Grand Slam champions", said Sharapova, who is looking to rediscover her best on her way back from a 15-month drugs ban. "My ankle is, I don't know how it is because I don't feel it anymore!"
"I gave everything I had today", said Simona Halep, who has been on painkillers after a twisted ankle in the first round. "I was a little bit stronger in that moment, for sure", said the world number one.
Halep saved three match points to hold to 11-11 and showed all her frustration to have to pause soon after.
Halep, a former quarter-finalist at Melbourne Park who slumped out in the first round past year, will next play Australian Ashleigh Barty or Japan's Naomi Osaka in her quest for a maiden Grand Slam title.
South Korean Chung Hyeon does not appear especially intimidating behind his Zen-like demeanour and white-framed spectacles but as German wunderkind Alex Zverev will testify, the 21-year-old should come with a health warning. She then played only one match after the U.S. Open before shutting down her season early to let the wrist heal.
During Halep and Davis' deciding set, No 6 seed Karolina Pliskova had the time to start and comfortably finish a 7-6 7-5 win over Czech compatiriot Lucie Safarova.
Halep nows plays either 18th seed Ashleigh Barty of Australia or Japan's Naomi Osaka in the last 16 after the longest match of the women's tournament so far. "Every point was super long", Davis said. "She's an incredible player", Davis said. She had three match balls.
Lauren Davis played a part in Australian Open history Saturday and the unheralded American is determined to build on her performance, despite bowing out in memorable fashion at Melbourne Park.
There was a sense of deja vu when the first two games of the second set went against serve, but Halep's athleticism and accuracy combined with a string of Bouchard errors ensured it was plain sailing for last year's French Open runner-up. She plays No.8 Caroline Garcia who reached her first fourth round at Australian Open as she completed a 6-3 5-7 6-2 win over Aliaksandra Sasnovich, who surrendered to a fourth top 10 defeat in five meetings.