Spain striker David Villa fired his team into the World Cup semi-finals with a late goal to sink plucky Paraguay 1-0 at Ellis Park on Saturday.
The game was heading for extra-time after both sides missed a penalty in a dramatic 90 minutes before Villa got his fifth goal of the tournament to set up a last four clash with Germany, who earlier thrashed Argentina 4-0 in Cape Town.
Until the goal, the hard-working South Americans had successfully nullified Spain's normally dominant midfield and created the clearer chances in a closely-fought first half.
The match burst into life shortly before the hour when the referee ruled that Spain defender Gerard Pique had hauled down Paraguay striker Oscar Cardozo in the penalty area.
Cardozo sent his spot kick low to the left of Iker Casillas but the Spain captain and goalkeeper saved comfortably.
There was more drama at the other end of the pitch minutes later when Spain were awarded a penalty after Villa went down under a challenge.
Xabi Alonso netted high to Justo Villar's right, sparking celebrations on the Spain bench but the referee made him retake it after players from both sides encroached into the area.
Alonso went low to Villar's left with his second attempt and after his shot was saved substitute Cesc Fabregas, on for the ineffective Fernando Torres, appeared to be hacked down but the referee awarded only a corner.
As Spain pressed for a winner, midfielder Xavi, who went close with a fizzing volley in the first half, drove narrowly wide and Andres Iniesta drew another fine save from Villar.
Villa, top scorer in the tournament, then grabbed the winner in the 83rd minute from a rebound after substitute Pedro had hit the post following a brilliant run by Andres Iniesta.