Gdansk, Poland – Jesus Navas came off the bench to score in the 88th minute on Monday, lifting Spain to a 1-0 win over Croatia that allows Spain to win Group C.
A 0-0 draw combined with Italy's 2-0 victory over Ireland would have pushed Spain into second place, but Navas rescued his side a few minutes from time to knock Croatia out of the tournament on a tiebreaker, with Italy finishing second.
Spain will now face the second-place team from Group D on Saturday in the quarterfinal round.
Chances were at a premium, especially in the first half, as Spain was limited to a handful of long-range efforts that didn't really trouble goalkeeper Stipe Pletikosa, who was really only forced into action once in the first 45 minutes as he kept out a tight-angle shot from Fernando Torres with his legs.
Spain dominated possession, as usual, but Croatia managed to generate a great chance just before the hour mark when Luka Modric crossed to the back post for a wide open Ivan Rakitic, who headed the ball straight at goalkeeper Iker Casillas.
It was a golden chance for Croatia, and Casillas was called upon again with 11 minutes to play when he got down to keep out a volley from substitute Ivan Perisic.
Despite creating few scoring opportunities, Spain dug down and found the winning a goal a few minutes time as Andres Iniesta timed his run perfectly and dashed into the penalty area, where brought down a lobbed pass and squared the ball to Navas, who walked it into the empty net.