Williams blazed through the first set in just 20 minutes but had to fight tooth and nail on Rod Laver Arena to put away the valiant Halep, prevailing 6-1 4-6 6-4 to book a quarter-final clash with Czech seventh seed Karolina Pliskova.
The victory, just 16 months after giving birth to daughter Olympia, secures an astonishing 50th grand slam quarter-final appearance for the 37-year-old American.
Having dropped a miserly nine games on her path to the fourth round, Williams raced through the opening set and looked primed to make short work of her Romanian opponent.
Halep lifted in the second set, working Williams around the court and roaring and pumping her fists after fighting back to even the ledger.
But even Halep's supreme defensive game wasn't enough to stop Williams, who managed to find another gear after saving three break points down 3-2 in the deciding set.
"I really needed to elevate my game," Williams said.
"She's the number one player in the world and there's a reason why ... in order to stay out there I had to play a little bit like I knew I could.
"I am just a fighter, you know I just never give up. It's definitely something that's innate. I just work so hard for every point."
The defeat leaves Halep at risk of losing her No.1 ranking with Japan's Naomi Osaka among four rivals who could ascend the summit depending on their remaining results.
In the men's draw world number one Novak Djokovic has edged closer to a seventh Australian Open title
Djokovic survived a survived a taxing fourth-round clash with rising star Daniil Medvedev.
In a grinding encounter on Rod Laver Arena that stretched into the early hours of Tuesday morning, Djokovic outlasted his 22-year-old opponent to claim a hard- fought 6-4 6-7 (5-7) 6-2 6-3 victory in three hours and 15 minutes.
The Serb will face Japan's Kei Nishikori in the quarter-finals and is on course for a potential championship showdown with long-time rival Rafael Nadal.
Djokovic took a tumble during the third set while attempting to retrieve a ball and was clearly running on empty after a match full of baseline rallies, the longest of which lasted 42 shots.
"Since I guess my next opponent is watching, I'm feeling fantastic. I've never felt fresher in my life," he quipped.
"Definitely a physical battle. Daniil has been playing some really good tennis in the last six months ... he defends well, he can come into the net.
"It was difficult to go through him so I had to find a different way. These kinds of matches, you just have to hang in there and wait for the opportunities."
The win secures Djokovic his first quarter-final appearance at Melbourne Park since 2016, having lost in the fourth round last year and second round in 2017.
The 31-year-old is a hot favourite to claim his 15th grand slam title on the back of triumphs at Wimbledon and the US Open.