Rae and Watson came through a tense doubles (Photo: LTA)
Great Britain secured their place in Fed Cup Europe/Africa Group I thanks to a dramatic doubles victory over Denmark in Eilat, Israel.
After defeats by Switzerland in their opening ties, both teams needed a win to avoid facing a relegation play-off.
Heather Watson beat Denmark's Karen Barbat 6-0 6-1 in the opening singles before Anne Keothavong lost 6-0 6-2 to world number one Caroline Wozniacki.
Watson and Jocelyn Rae then defeated Wozniacki and Mai Grage 5-7 7-5 7-5.
Britain will play Croatia on Saturday to determine their final seeding from the 15-team event for future ties.
"It was really exciting out there today," said Rae. "There were definitely some stressful points in the match as we had quite a lot of chances to convert.
I am so proud of the way the young girls handled the pressure of the deciding doubles and that was a clutch win
GB team captain Nigel Sears
"We did really well to keep going and we played well, and it's always good to beat the number one player in the world. It was great to play Wozniacki. We went on court hoping to win but we knew it would be a tough match as she's the best player in the world.
"Today was obviously an important match as we didn't want to be in the relegation play-offs, so we're really pleased we came through it and hopefully if I play tomorrow I can get another win under my belt."
GB team captain Nigel Sears said: "I am so proud of the way the young girls handled the pressure of the deciding doubles and that was a clutch win.
"When you play the number one in the world, even in doubles, anything can happen. And she kept testing the girls every time she played the ball. It was a magnificent fighting effort and I am so pleased to come through that match.
"On the singles front, in terms of Anne's match, it's tough enough to play the world number one when you're fully healthy - when you're carrying an injury it's even harder. But I thought she gave her best in the circumstances and I was really pleased with that.
"Heather did a great job kicking the match off with a very decisive win over their number two. She always looked in control of the match and she's had a good day's work!"