Alex de Minaur and Thanasi Kokkanikis have dragged Australia into the Davis Cup finals group stage in a thrilling 3-2 qualifying win over Hungary in Sydney.
The unfancied Hungarians grabbed a shock 2-1 lead with a stunning doubles victory on Saturday before de Minaur and Kokkinakis embarked on a steely rescue mission at Ken Rosewall Arena.
Kokkinakis sealed the tie with a 6-4 6-4 triumph over Zsombor Piros after de Minaur defeated Marton Fucsovics 7-6 (7-4) 6-4 in an electrifying match-up between the two nations' No.1s.
The great escape marks only the third time this century Australia have overturned a 2-1 deficit in Davis Cup.
Australia captain Lleyton Hewitt featured in the previous two comebacks, upstaging Roger Federer in the fourth rubber in Zurich in 2000 before Mark Philippoussis beat George Bastl to clinch the tie.
Hewitt and Sam Groth also saved Australia on the last day of the 2015 quarter-final against Kazakhstan in Darwin after Nick Kyrgios lost to world No.115 Aleksandr Nedovyesov and infamously declared "I don't want to be here".
There were no such theatrics from de Minaur and Kokkinakis, but no less tension either as the pair delivered for Hewitt and their country under untold pressure.
Mate Valkusz and Fabian Marozsan's 6-4 6-4 doubles defeat of John Peers and Davis Cup debutant Luke Saville had Australia staring down the barrel of an inglorious exit from the 2022 competition.
Hungarian captain Zoltan Nagy only drafted in Valkusz -- ranked 1312th in doubles and 439th in singles -- as a last-minute replacement for Fuscovics.
But the captain's call paid unexpected dividends.
"It's crazy," Valkusz said after winning his first-ever Davis Cup match.
Fucsovics was rested after digging deep to beat Kokkinakis 7-6 (7-4) 1-6 6-3 in Friday's second singles rubber to level the tie at 1-1 after de Minaur gave Australia the early initiative with a 7-5 6-2 victory over Piros.
But despite Hungary easing Fucsovics' workload, de Minaur wore the world No.35 down in the sapping humidity under the arena's closed roof.
De Minaur rallied from 3-0 down in the crucial first-set tiebreaker and then withstood a fierce second-set fightback from Fuscovics to finally seal the must win on his fourth match point.
"This Aussie team is going to do everything to leave it all out there on the court," de Minaur said.
"We've got immense pride, immense passion and one thing you can count on from the Aussie Davis Cup team is we're never going to give up."
No one could accuse Kokkinakis of ever giving up.
A catalogue of injuries had sidelined the 25-year-old from Davis Cup since 2015 but his win over Piros completed a memorable summer hat-trick for the born-again baseliner.
He captured his maiden ATP singles title in Adelaide in January, then teamed with Nick Kyrgios to win the Australian Open doubles and has now piloted his country into September's Davis Cup finals group stage.
The full make-up of the 16-team playoffs in Europe will be decided after the completion of this weekend's other 11 qualifying ties.
AUSTRALIA BEAT HUNGARY 3-2
Alex de Minaur (AUS) bt Zsombor Piros (HUN) 7-5 6-2
Marton Fucsovics (HUN) bt Thanasi Kokkinakis (AUS) 7-6 (7-4) 1-6 6-3
Fabian Marozsan/Mate Valkusz (HUN) bt John Peers/Luke Saville (AUS) 6-4 6-4
De Minaur (AUS) bt Fucsovics (HUN) 7-6 (7-4) 6-4
Kokkinakis (AUS) bt Piros (HUN) 6-4 6-4