An Ashleigh Barty trifecta helped Australia avoid an almighty Fed Cup upset against Ukraine in Canberra on Sunday.
The World Group II tie was pushed to the deciding doubles match after an out-of-form Daria Gavrilova sensationally dropped both her singles rubbers.
World No.16 Barty backed up her two singles wins by reigniting her successful doubles partnership with Casey Dellacqua to deliver Australia a 3-2 win.
The result means Australia advances to the World Group play-offs in April, putting them one win away from the Fed Cup's top-eight nations for the first time since 2015.
An opponent for Australia's play-off match is expected to be announced on Tuesday night (AEDT).
An emotional Dellacqua celebrated her 33rd birthday by defeating Ukraine's twin sisters Nadiia and Lyudmyla Kichenok 6-3 6-4 with Barty in what she said was a career highlight.
A text message from Samantha Stosur, who made herself unavailable for the tie, on Sunday morning reminded Dellacqua about the live doubles rubber win the pair had in Slovakia in 2016.
"This tops that... being here at home in Canberra and playing for your country is definitely one of the best moments of my career," Dellacqua said.
The result saved face for Australia, with Ukraine entering the tie as serious outsiders due to being without world No.3 Elina Svitolina and being led by teenage prodigy Marta Kostyuk on her Fed Cup debut.
Australia requested the tie to be played on grass, with a temporary surface laid for Canberra's first Fed Cup tie in 20 years.
After Barty overcame early nerves to defeat Lyudmyla Kichenok 4-6 6-1 6-4 in the opening rubber on Saturday, Kustyok, 15, responded by upsetting world No.26 Gavrilova to level the tie 1-1.
Barty and Kustyok were up first on Sunday, with the Queenslander too strong for the Ukrainian dubbed the next Martina Hingis, winning 6-2 6-3.
But Gavrilova's troubles on grass continued in her reverse singles rubber, with unranked Nadiia Kichenok delivering a shock 4-6 6-2 6-3 triumph.
Ukraine captain Mikhail Filima subbed in Nadiia for Lyudmyla only minutes before the match in what proved to be a masterstroke.
Gavrilova said she was shattered by her defeats, but tried to put it behind her quickly.
"I was crying so much after the match, but I had a cold shower and said 'Okay, you have to be there for your teammates'," Gavrilova said.
"I didn't have the best singles matches... to be honest I had two shockers but I've got to learn from this experience."