Top seed Simona Halep pushed Serena Williams all the way, but the 23-time major singles champion moved into the last eight in Melbourne.
Serena Williams came through an enthralling battle with world number one Simona Halep to reach the quarter-finals of the Australian Open.
Williams had only lost nine games en route to the fourth round and looked to be heading for another emphatic win, but she was forced to fight it out to prevail 6-1 4-6 6-4 in a classic on Rod Laver Arena.
The legendary American was pushed all the way by the top seed on Monday as she strives to match Margaret Court's record tally of 24 major singles titles and will face Karolina Pliskova in the last eight - her 50th grand slam quarter-final.
Halep came storming back after being blown away in the first set, but Williams saved three break points to hold at 3-3 in the decider and broke in the following game before going on to wrap up a hard-fought victory.
Williams has now won nine of her 10 encounters with the French Open champion, who is in danger of losing her top-ranked status.
The powerful Williams struck 44 winners in a gripping contest, Halep bowing out with her head held high as her wait for a first win over the 37-year-old since 2014 goes on.
Halep beat Venus Williams in the third round and got off to a blistering start against her younger sister, fizzing a forehand winner down the line to go 0-40 up and breaking to love when the seven-time Australian Open champion double-faulted.
Williams hit back immediately, working the angles superbly as she bombarded the 27-year-old with venomous groundstrokes to go a break up at 3-1.
Halep's first serve was not firing and Williams capitalised, drilling a forehand return winner beyond the Romanian with disdain to go 5-1 and serving out the set to love with a booming ace.
Williams was clearly in no mood to hang around as she broke for a 2-1 lead in the second, but Halep showed her fighting spirit to get back on serve, forcing a backhand error from her opponent.
The counter-punching Halep demonstrated her incredible defensive ability and whipped wondrous backhand winners beyond one of the all-time greats, who was pegged back at a set apiece when she sent a backhand wide.
Williams was breathing increasingly heavily in a pulsating encounter, but dug herself out of a hole to level at 3-3 after the fired-up Halep saw three break points come and go.
It was the clean-striking Williams who struck the crucial blow in the third set, breaking when Halep thudded a forehand into the net and holding her nerve to advance.
S Williams  bt Halep  6-1 4-6 6-4
Williams - 44/31
Halep - 24/12
Williams - 9/2
Halep - 2/2
BREAK POINTS WON
Williams - 5/10
Halep - 3/7
FIRST SERVE PERCENTAGE
Williams - 60
Halep - 65
PERCENTAGE OF POINTS WON ON FIRST/SECOND SERVE
Williams - 77/42
Halep - 75/31
Williams - 86
Halep - 77