Spain scraped past Paraguay, 1-0, and into the World Cup semi-finals.
The European champions were far from comvincing and, after both sides wasted a penalty each, needed a David Villa goal seven minutes from time to set up a clash with Germany.
As expected, Spain coach Vicente del Bosque stood by out-of-form striker Fernando Torres, while opposite number Gerardo Martino made changes to the team that needed penalties to see off Japan, axing Roque Santa Cruz, Lucas Barrios and Edgar Benitez from his starting XI.
The South Americans started brightly and Jonathan Santana forced an early save from Iker Casillas, but neither goalkeeper was truly tested as both sides toiled.
Antolin Alcaraz almost got on the end of a dangerous free-kick and it took until the 30-minute mark for Spain to muster an opening, Xavi turning and volleying just over the bar from 25 yards after a poor first touch saw the ball pop up into the air.
Paraguay thought they had snatched surprise lead 10 minutes before the break when Nelson Valdez met Claudio Morel Rodriguez's teasing cross to slot home, but the flag was up for offside against Oscar Cardozo who had attempted to get his head to the ball.
Del Bosque finally lost patience with Torres after the restart and sent on Cesc Fabregas, and the arrival of the Arsenal man seemed to give the Spaniards a little more creativity.
The game then finally burst into life on 55 minutes, albeit in bizarre fashion.
Paraguay were awarded a penalty when Gerard Pique fouled Cardozo, but the striker saw his effort saved well by Casillas.
Spain almost immediately pushed forward and the referee again pointed to the spot when Alcaraz bundled over Villa, and the Paraguayan was incredibly fortunate not to receive a red card for his offence.
Xabi Alonso calmly fired home and began his celebrations only for ref Carlos Batres to order a re-take due to encroachment by several players. Alonso this time tried to place his spot-kick into the bottom corner but Justo Villar saved, but then appeared to trip Fabregas as he tried to gather the ball, but Spanish appeals for a second penalty were waved away.
But just as the game looked destined for extra time Andres Iniesta embarked on a run and laid the ball off for Pedro who clattered the post, but Villa reacted quickest to slam home off the inside of the same upright for his fifth goal of the World Cup.
Paraguay almost snatched an equaliser in the closing moments when Casillas fumbled a Barrios strike on goal, but the Spanish keeper made amends by blocking Santa Cruz's effort with his legs.
Spain: Casillas, Pique, Puyol, A Iniesta, David Villa, Xavi, Torres, Capdevila, Alonso, Ramos, Sergio.
Goal: Villa 83
Paraguay: J Villar, Veron, Morel R, Cardozo, E Barreto, Santana, Da Silva, V Caceres, Riveros, Valdez, Alcaraz.