Supersub Raul sparked a late revival as Spain came from behind to beat Tunisia 3-1 in World Cup Group H and book a spot in the knockout stages.
The Real Madrid icon came off the bench to grab the equaliser on 72 minutes after Luis Aragones' side had trail to an early strike by Jaouhar Mnari.
And then a brace from Fernando Torres wrapped up a slightly flattering victory.
Spain made a bright start with David Villa cracking a 25-yard angled volley into the sidenetting of Ali Boumnijel's goal.
But it was Tunisia who took a surprise lead after eight minutes when Mnari fired past Iker Casillas after the Spain goalkeeper had blocked his volley following excellent work by Zied Jaziri.
The stunned Spanish tried to hit back immediately through Villa's curling free-kick but it was comfortably punched clear by Boumnijel.
Luis Garcia then played a nice pass down the right-hand channel for Torres but his first-time strike was sliced well wide.
Tunisia tried their luck with a Anis Ayari free-kick, while at the other end Garcia planted a free header from a Xavi free-kick wide of the far post.
Xabi Alonso then flashed a sizzling 25-yard drive just wide, while Torres' effort from a similar distance was tipped over by Boumnijel at the expense of a corner.
From the resulting corner kick, Alonso placed an unchallenged header goalwards but Ayari stooped to head the ball off the goalline.
Spain started the second half with even more urgency, with substitute Cesc Fabregas going close with a thumping 25-yard effort, while Mariano Pernia's drive skipped just wide on the wet surface.
But the equaliser finally arrived after 72 minutes when Raul reacted quickly to prod the ball over the line after Fabregas' shot was blocked by Boumnijel following good work down the right by Joaquin.
And they quickly turned the game on its head as they moved 2-1 ahead five minutes later after Fabregas' pass released Torres, who rounded Boumnijel and fired into the empty net.
The goal was no less than Spain deserved and Torres, after a missing a one-on-one with Boumnijel, added his third of the tournament from the penalty spot after Yahia had pulled him back in the area.
The Atletico Madrid striker now leads the race for the Golden Boot.