Substitute Fernando Morientes scored twice as Spain came from behind to beat Paraguay 3-1 in their group B match on Friday to become the first side to reach the second round of the World Cup.
Paraguay had taken a surprise lead in the 10th minute when right back Carles Puyol put through his own net.
But Morientes, who had replaced Diego Tristan at halftime, levelled the scores with a header from a Javi de Pedro corner in the 53rd minute and then bundled home Spain's second from close range in the 69th minute.
Captain Fernando Hierro made the game safe with a penalty in the 82nd minute.
Spain's win leaves them top of the group on six points and ensures the habitual under-achievers a place in the last 16.
Paraguay have one point, level with South Africa, who meet Slovenia in their group B match on Saturday. The Slovenians have no points.
With 10 minutes, Spain's World Cup nightmares seemed to have resurfaced when Puyol finished off Paraguay's first attack of the game by scoring an own goal.
The shaggy-haired right back was running back towards his goalmouth when Paraguay defender Francisco Arce fired in a fierce, swerving shot from the corner of the Spanish box.
Spanish goalkeeper Iker Casillas palmed the shot clear but the ball ricocheted off Puyol's leg and flew into the Spanish net. There was little the defender could do about it.
Spain struggled to break down a well-organised Paraguayan defence for the rest of the half and, despite a couple of efforts from Raul, they went in 1-0 down at halftime.
Coach Jose Antonio Camacho threw on Morientes at the start of the second half and the substitution worked wonders.
Seven minutes into the half, De Pedro swung in a corner and Morientes planted a firm downward header into the goal.
The two players combined again for Spain's second.
De Pedro crossed from the touchline and Morientes bundled the ball in from close range with Paraguayan goalkeeper Jose Luis Chilavert left flapping at the ball.
Chilavert tried to find an equaliser with one of his famous free kicks but Casillas saved it and Spain went on to win their penalty when Raul was brought down by Carlos Parades, which Hierro duly converted perfectly.