Dominic Thiem fought off Nick Kyrgios and a rowdy crowd to overturn a two-set deficit in a thrilling match and reach the Australian Open fourth round.
Austrian third seed Thiem weathered everything home favourite Kyrgios threw at him to prevail 4-6 4-6 6-3 6-4 6-4.
Kyrgios had his opportunities but his shot selection - and occasionally his temper - let him down.
The match finished 50 minutes before Melbourne Park closes its doors to fans as Victoria begins a five-day lockdown.
US Open champion Thiem will play Grigor Dimitrov of Bulgaria for a place in the quarter-finals.
This was a fitting way for the crowds, who have been so vocal for Kyrgios, to say goodbye to the tournament for now.
They were treated to the full range of Kyrgios' brilliant shots and lapses of concentration, as well as a hardy, gutsy performance from Thiem.
The two players shook hands and had a warm conversation at the net, before Thiem was given a standing ovation by the fans.
- Follow live action from day five in Melbourne
- Live scores, results and order of play
- Williams & Osaka overcome slow starts
"A first match against Nick on his favourite court with an amazing crowd - there are easier things to do," Thiem joked afterwards.
"I was dealing with the loss already before somehow I fought back in."
It is the fourth time Thiem has come from two sets down to win at a Slam, which he memorably did to claim his first major title in New York in September.
Thiem is joined in the fourth round by defending champion Novak Djokovic, who struggled with an injury in a five-set victory over American 27th seed Taylor Fritz.
The Nick Kyrgios way
Although he ended up the loser, this was vintage Kyrgios - underarm serves, powerful forehands, questionable shots at key times and, above all, feeding off an adoring crowd.
Thiem occasionally looked overawed in the opening stages, Kyrgios setting the tone as he broke in the first game of the match before asking the fans to give him more noise.
The Australian energised himself, pumping the air with his fist as he took the first set, and the pressure told on Thiem.
The third seed held off four break points in the second but Kyrgios - and the crowd - would not go away, with Kyrgios closing out the set in trademark audacious style with an underarm serve.
Kyrgios' fitness was always a question after his five-set match against Ugo Humbert on Wednesday and he was put to the test in a 10-minute opening game of the fourth set.
The game featured five deuces, Kyrgios taking advice from a fan in the crowd and serving down the T to wrong-foot Thiem and the home favourite thumping his chest as he staved off two break points.
In truth, Kyrgios could have avoided a fifth set - serving for a 5-4 lead, he got to 30-0 before two inexplicable shots between the legs and some poor rushes to the net handed Thiem the break he needed.
He was also given a point penalty for swearing, rowed with the umpire about whether or not his grunting was a hindrance and also found time to complain about the line-calling technology.
But, as commentators remarked, that is simply the Nick Kyrgios way.
Thiem goes into the zone
The John Cain Arena somehow got louder for the fifth set, with Kyrgios feeding off their energy.
It was at 3-3 when the crucial break came. Thiem looked to have blown his chance to break the Kyrgios serve, dropping to his haunches when a simple slice backhand went long.
However, he took his second chance, showing emotion for the first time in the match after a return-of-serve winner, turning to his box and shaking his fist in celebration.
Another brilliant backhand from Thiem - his 57th winner of the match - enabled him to wrap up victory in three hours 24 minutes.
Qualifier Karatsev shocks Schwartzman
Earlier, qualifier and world number 114 Aslan Karatsev stunned eighth seed Diego Schwartzman.
The Russian, making his first Grand Slam main-draw appearance, beat the Argentine 6-3 6-3 6-3 and he has not lost a set since the first round of qualifying.
He will play Felix Auger-Aliassime, who beat Canadian compatriot and close friend Denis Shapovalov 7-5 7-5 6-3.
Sixth seed Alexander Zverev, a semi-finalist at Melbourne Park in 2020, beat France's 36th-ranked Adrian Mannarino 6-3 6-3 6-1.
Bulgarian 18th seed Grigor Dimitrov led Pablo Carreno Busta 6-0 1-0 when the Spaniard withdrew with injury.
- Standing Up To Infertility: Rhod Gilbert with a frank, funny and personally revealing look at the condition
- Scarlett Moffatt Wants To Believe: What is the theory behind ghost sightings and does it prove anything?