Great Britain qualified for the Fed Cup World Group II play-offs with a 2-1 victory over Croatia.
The tie was decided in the final doubles contest, with Johanna Konta and Heather Watson beating Ana Konjuh and Darija Jurak 4-6 6-4 6-3.
Earlier, British number two Watson beat Donna Vekic 6-2 6-4 to give GB the lead in Tallinn, Estonia.
But leading Briton Konta lost 6-4 6-3 to Konjuh in the following singles match as the tie went to a decider.
Captain Keothavong 'proud' of team
Captain Anne Keothavong said she was "absolutely ecstatic" with her team's victory.
"It's been a real emotional rollercoaster, but the way the girls performed today and throughout the whole week, I'm just so proud of them," she said.
"It was so tight, everyone was on the edge of their seats. But they fought their hearts out and played with so much passion. I'm so proud of them."
Konta and Watson were broken twice in the opening three games of their doubles match as they lost the first set 6-4.
There was cause for concern when Australian Open quarter-finalist Konta needed treatment on her ankle early in the second set. But the world number 10 overcame the problem as the British pair levelled.
The opening four games of the deciding set went against serve before Konta and Watson secured the decisive break en route to victory.
Keothavong's team will now play one of the four losers from the World Group II matches.
BBC Radio 5 live tennis correspondent Russell Fuller
The first big selection decision of Keothavong's captaincy proved successful, as Konta and Watson recovered from a set down, and twice a break of serve down in the decider, to wrap up the tie.
Laura Robson and Jocelyn Rae were Britain's first-choice doubles pair in the group matches in Tallinn, but were asked to make way for the higher-ranked singles players.
Britain crave a first home Fed Cup tie for 24 years, but depending on what happens in other ties this weekend, could end up heading to Australia or Chinese Taipei in April.
The draw takes place on Tuesday.
Fed Cup format
Unlike the men's team competition, the Davis Cup, which has a World Group of 16 nations, the Fed Cup divides its top teams into two groups of eight - World Group I and World Group II.
The 91 nations outside the top tiers are divided into three regional zones and Britain have one chance per year to escape - a format that hugely frustrated former captain Judy Murray.
The Europe/Africa Group I event, in Estonia, was made up of 14 teams divided into groups, with Poland, Croatia, Britain and Serbia the seeded nations.
Four group winners progressed to the promotion play-offs, with Britain one of the two nations to qualify for World Group II play-offs in April - which could see them given a home Fed Cup tie for the first time since 1993. Poland and Serbia are competing for the other place.
GB fell at the same stage in 2012 and 2013 - away ties in Sweden and Argentina - under the captaincy of Judy Murray.