Carles Puyol scored the only goal of the game to send Spain into the World Cup final against The Netherlands against Germany on Wednesday.
The Barcelona centre-back powered home a header from 10 yards from Xavi’s corner 17 minutes from time to send the reigning European champions into their first World Cup final.
The Netherlands reached the title game by beating Uruguay 3-2 in Cape Town on Tuesday.
It means there will be a new name on the trophy for the first time since France claimed victory on home soil in 1998.
“All of our players were extraordinary — but we still have a match to play,” said Spain coach Vicente Del Bosque.
“We know Dutch football and it will be very tough in the final.”
Del Bosque had sprung a surprise before kick-off by dropping out-of-form Liverpool forward Fernando Torres and replacing him with Barcelona youngster Pedro.
That move allowed tournament top scorer David Villa to play through the middle and the switch almost paid dividends six minutes into the game.
Pedro came in off his wing and slipped a delightful ball in behind the Germany defence which Villa ran on to but he had to slide in to shoot before Manuel Neuer arrived and he succeeded only in prodding the ball into the goalkeeper’s chest.
Spain should have gone ahead on 14 minutes after a cleverly-worked corner routine left Andres Iniesta free to cross from the right, but Puyol got too much purchase on his diving header and sent the ball over the bar.
Germany were stretched again on 19 minutes as a great cross-field ball from Xabi Alonso found the marauding Sergio Ramos but after an exquisite piece of control his shot was wild and high.
Germany finally threatened on 32 minutes when Piotr Trochowski, in for the suspended Thomas Mueller, shot from distance and forced Iker Casillas into a sprawling save low to his left.
Mesut Ozil thought he should have had a penalty on the stroke of half-time when he went down under a challenge from Ramos but his appeals were waved away by referee Viktor Kassai.
For all their pretty approach play, Spain were struggling to get into the box and started hitting pot shots from distance with Alonso, twice, and Villa shooting wide.
Neuer then saved from Pedro, who moments later shot wide while Villa was inches away from a tap-in after Iniesta jinked into the box and squared the ball across goal.
Up the other end substitute Marcell Jansen’s cross was flicked on by a Spanish head, but on the turn Miroslav Klose could only volley high.
On 69 minutes Germany created possibly their best chance of the match as substitute Toni Kroos arrived unmarked at the back post on to Lukas Podolski’s cross but his finish was weak and straight at Casillas.
But then came Puyol’s great leap to propel Spain into the final.
Spain had several chances on the counterattack later on but Pedro wasted the best of those as he tried to turn Arne Friedrich once too often instead of squaring to the unmarked substitute Torres — on for Villa.
“I am very happy — we played our best match of the World Cup.
Now we have to win it,” said a delighted Villa. – AFP