Great Britain will face Australia in their first appearance in the Billie Jean King Cup semi-finals for 41 years after a shock 3-0 victory over Spain on Thursday.
Anne Keothavong's side needed to sweep the two singles matches and the doubles to avoid elimination at the Emirates Arena in Glasgow.
The hosts were heavy underdogs against the five-time champions after a crushing 3-0 defeat against Kazakhstan in their Group C opener on Tuesday.
But Britain, who have never won the tournament, defied the odds thanks to Heather Watson and Harriet Dart in the singles and Alicia Barnett and Olivia Nicholls in the doubles.
Watson is 61 places below Nuria Parrizas Diaz in the WTA rankings but beat the Spaniard 6-0, 6-2.
Dart was even more impressive as she ignored a 85-place gap in the rankings to beat world number 13 Paula Badosa 6-3, 6-4.
Dart wept tears of joy on court after her victory and there were more emotional scenes when Barnett and Nicholls beat Aliona Bolsova and Rebeka Masarova 7-6 (7/5), 6-2 in the decisive doubles.
The inexperienced pair were late call-ups following the withdrawal of injured former US Open champion Emma Raducanu from Britain's squad.
Britain, who last reached the semi-finals during the competition's Fed Cup era back in 1981, are only in the 12-team tournament after being given a wildcard as hosts despite losing a qualifier to the Czech Republic in April.
"This is something really special. I'm just so proud of this team. This morning we knew what we had to do," Keothavong said.
"It was always going to be a big ask but the girls delivered. Through to the semi-finals, we have to allow ourselves to dream a little bit."
Earlier, victories for Ajla Tomljanovic and Storm Sanders sent Australia through to the last four as Group B winners with a 3-0 victory over Belgium.
Sanders thrashed Alison van Uytvanck 6-2, 6-2 before Tomljanovic benefitted from Elise Mertens' retirement when the Australian was leading 4-6, 6-4, 3-0.
Mertens had come straight from winning the WTA Finals doubles title on Monday in Texas.
The fatigued Belgian needed treatment on her shoulder in between the second and third sets and, after falling behind in the decider, she was forced to retire.
Belgium captain Johan Van Herck said he was frustrated that his team had less rest.
"We were not helped by the situation," he said. "What happened with Elise, I don't think it's very correct.
"It had a huge impact on what we had to go through here, especially Elise now with an injury. It's something where we, as a small country, have to pay a price."
In Group D, the Czechs won 2-1 gainst Poland to keep alive their hopes of advancing from Group D in a winner-takes-all clash with the United States on Friday.
After crushing Italy 3-0, Canada face a do or die encounter with 2021 runners-up Switzerland on Friday in Group A with a place in the semi-finals at stake.