Great Britain recovered from the brink of elimination to beat Ukraine and top their Fed Cup qualifying group.
Even though Johanna Konta and Heather Watson won their singles matches, Anna Smith and Jocelyn Rae still had to save a match point to win the one set of doubles they required to go through.
Britain will now contest a Group I play-off against Victoria Azarenka's Belarus on Saturday in Budapest.
The winners will progress to the 16-team World Group II play-offs in April.
Following their defeat by Turkey on Thursday, GB needed to beat Ukraine convincingly to advance.
World number 145 Konta, 23, beat Lesia Tsurenko - a player ranked 53 places above her - 6-3 6-2, before British number one Watson, 22, fought back from a set down to defeat Elina Svitolina 2-6 7-5 6-4.
Smith, 26, and Rae, 23, lost the first set of their doubles contest on a tie-break and saved a match point that would have eliminated Judy Murray's squad before sealing the tie 6-7 (6-8) 7-5 6-4.
"There were so many epic points," said Smith. "I just remember running a lot. We just showed guts and determination to pull through."
Rae added: "This level is a bit new to us so the fact that we pulled through is positive. It was a massive team effort."
Murray paid tribute to her team for bouncing back from the blow of the Turkey reverse.
"It was an amazing day today," she said.
"We had such a disappointing day yesterday and everyone was very flat leaving the courts. But we managed to turn it around.
"It really was a fantastic performance form the girls and sets us up nicely for the play-off tomorrow and we will throw the kitchen sink at it."
|BBC Sport's Piers Newbery|
|After a poor day on Thursday when both lost to lower-ranked players, Konta and Watson turned around their fortunes spectacularly to beat Ukraine's world number 92 and 26 respectively. Rae and Smith have been the revelation of the week, however, winning all three doubles rubbers and giving a new depth to captain Judy Murray's squad. Belarus, with Azarenka, provide tough opposition on Saturday but Britain have huge momentum. The prize for another victory could be a first home tie for Britain's women since 1993, depending on the World Group II play-off draw.|