An 88th-minute goal by substitute Jesus Navas gave Spain a 1-0 victory over Croatia that sent them into the Euro 2012 quarter-finals as Group C winners on Monday.
The world and European champions endured a nervous night but were still set to go through in second place as Italy led Ireland but Navas settled things when Cesc Fabregas and Andres Iniesta combined to feed Navas who tucked the ball into an empty net with the Croatians appealing for offside.
Croatia should have gone ahead after an hour when Luka Modric picked out an unmarked Ivan Rakitic only for him to head straight at Iker Casillas in a missed chance that will haunt him for years.
The result leaves Spain on seven points, with Italy on five after they beat Ireland 2-0. Croatia have four points.