Anne Keothavong’s side had initially missed out on qualifying for the event but were given a spot to compete when Glasgow stepped in as hosts.
After losing their opening match to Kazakhstan, they knew only a clean sweep of wins was enough against the Spanish to make Saturday’s semi-final.
And the previously unheralded Olivia Nicholls, who won the doubles with Alicia Barnett, admitted they had been inspired by being the heavy underdogs.
“I think a lot of people wrote us off,” she said. “The camaraderie, we just wanted to do it for each other and I think it showed in the results today.
“I genuinely didn’t want to go home tomorrow. I want to stay here and I want to play the next round.”
The shock result, even with British No1 Emma Raducanu absent with a wrist injury, means Britain are in the last four of the competition for the first time since 1981.
Captain Keothavong described it as “a momentous occasion”. She said: “We are fortunate to be in this competition for reasons you’re all aware of but to then deliver and get through to the semi-finals, I mean, it’s incredible.
“It’s down to the players. The way they approached the match today was just amazing. It sure is historic. This is something really special.”
Heather Watson, brought in at the last minute to replace Katie Boulter, beat Nuria Parrizas-Diaz 6-0, 6-2 before Harriet Dart stunned world No13 Paula Badosa 6-3, 6-4.