The Germans earned their own comeback win over Argentina to reach the last four.
The Spaniards, without world No.1 Carlos Alcaraz after he pulled out on the eve of the event with a hamstring injury, had their backs against the wall when Pablo Carreno Busta was beaten in straight sets by Jakub Mensik.
Carreno Busta, ranked 89th, had no response to Mensik's power and 20 aces, going down 7-5 6-4 to the world No.19.
Mensik suffered a break midway through the first set but held tough and broke back twice to bag it. He gave away no other break opportunities, snatching the second set with a late break of his own to put his team in front.
Even without Alcaraz, Spain had enough quality to stage a successful comeback with Jaume Munar drawing them level with a 6-3 6-4 win over Jiri Lehecka. Munar, who earned his first Davis Cup win, needed a break in each set to get past his opponent.
It then came down to the doubles match with 39-year-old veteran Marcel Granollers and Pedro Martinez edging past Mensik and Tomas Machac 7-6 (10-8) 7-6 (10-8) in an entertaining encounter.
Argentina's Tomas Etcheverry fired 23 aces to earn a straight-sets victory over Jan-Lennart Struff in the last quarter-final of the day, but the Germans responded with Alexander Zverev's 6-4 7-6( 7-3) victory over Francisco Cerundolo to send the tie into yet another doubles decider.
There was drama in the decider that lasted almost two and a half hours.
Argentina's Horacio Zeballos and Andres Molteni saved four match points but wasted two themselves in the third set tiebreak before Germany's Kevin Krawietz and Tim Puetz battled back to a 4-6 6-4 7-6 (12-10) victory to send their team to the last four.
In the other semi-final, hosts Italy, who are also missing world No.2 Jannik Sinner and world No.8 Lorenzo Musetti, are eyeing a Davis Cup "three-peat" after easing past Austria in Bologna on Wednesday to set up a semi-final clash against Belgium.