The defending champions topped Group C with the 1-0 win as Croatia went out.
Gdansk: Spain have qualified for the Euro 2012 quarter-finals after an uninspiring 1-0 win against Croatia at the PGE Arena on Monday.
Neither side seemed in any hurry to snatch the initiative throughout, with La Roja's famed tiki-taka football failing to break down a determined defensive barrier set up by Slaven Bilic's men.
The match seemed destined to end in a stalemate, but with two minutes remaining, substitute Jesus Navas walked the ball into the net to confirm Croatia's exit from the tournament.
The defending champions now progress to the last eight as the winners of Group C alongside runners-up Italy, where they will face either France, England or Ukraine.
Vicente del Bosque named an unchanged lineup from the 4-0 win over Ireland, with two-goal hero Fernando Torres continuing as the lone presence in attack.
Bilic meanwhile made two alterations to his XI from the 1-1 draw with Italy, with Domagoj Vida and Danijel Pranjic coming in as replacements for Nikica Jelavic and Ivan Perisic.
It was a cagey opening to the match, with Croatia content to sit back and soak up the pressure from Spain– whose possession figures reached 78 percent during the first 20 minutes.
Eventually La Roja would manage a sight on goal through Torres, who managed to squeeze in a shot while being forced to the byline by Gordon Schildenfeld, though Stipe Pletikosa was able to save.
Spain’s next offensive threat would come from their centre-back pairing, with both Sergio Ramos and Gerard Pique peppering the Croatia goal from long range.
Ramos would almost blunder moments later, with a meaty challenge inside the area on Mario Mandzukic deemed legitimate by referee Wolfgang Stark, despite the incredulity of Vedran Corluka, who was booked for his protests.
For all their monopolization of possession though, Spain were unable to fashion any clear cut chances as the match petered out into half-time scoreless.
Croatia were looking the part defensively, but with news of Italy’s lead over Ireland filtering through at the interval, knew that a breakthrough would be needed at the other end of the pitch.
And they would nearly get it just before the hour mark. Luka Modric was the architect, skipping free on the right, before bending a cross with the outside of his boot onto the head of Ivan Rakitic, who was thwarted by Iker Casillas from point blank range.
Spain’s tiki-taka football was getting them nowhere, and Del Bosque responded by hauling off Torres for Navas, hoping to use the Sevilla man to introduce more width.
Bilic responded in kind, bringing on Jelavic and Perisic in a bid to find the goal that would salvage their participation in the tournament.
The Dortmund midfielder snatched at a chance moments after his arrival, sending a half-volley over the bar after a good delivery from Darjo Srna.
That was the cue for another change for Spain, Cesc Fabregas making his entrance for the final 20 minutes in place of David Silva.
With Italy still ahead in Poznan, matters remained finely poised in Gdansk, with a goal from one side enough to eliminate the other.
Perisic had another opportunity with 10 minutes to go, but his volley was parried by Casillas as the near post, moments after Fabregas’ dallying on the ball cost him a gilt-edged shooting opportunity.
Iniesta broke free down the left and fired away at goal, but once more, the opening was nothing but a half-chance and easily saved by Pletikosa.
However in the 88th minute, a swift attack saw Iniesta break free, where he squared to Navas for the simplest of goals.
Croatia rushed to respond, but with news of Italy's late second against Ireland rippling throughout the stadium, Bilic's men simply ran out of time.