Ivan Perisic scored in the 87th minute as Croatia stunned Spain in a 2-1 comeback victory Tuesday to finish top of Group D at the European Championship.
His winning goal gave Croatia its first victory over Spain in 22 years and ended its unbeaten run at a European Championship that stretched back to 2004.
Defeat means that Spain will now meet Italy in the round of 16 at the Stade de France in Saint-Denis. Croatia will play one of the third-place teams in the northern French city of Lens.
It had all started so well for Spain, when striker Alvaro Morata put his side ahead in the seventh minute, redirecting the ball into the net after a shot by midfielder Cesc Fabregas. Spain playmaker David Silva had split open the Croatia defense with a through-ball to create the chance.
Nikola Kalinic equalized just before halftime with a nice back-heel flick that beat Spain goalkeeper David De Gea at the near post after Perisic delivered the cross from the left.
Spain had a chance to retake the lead, but defender Sergio Ramos saw his penalty saved by Croatia goalkeeper Danijel Subasic in the 72nd minute.
It proved to be a costly miss when Perisic fired in the winner with a few minutes left in the match. Perisic scored with a low left-foot shot, beating goalkeeper David De Gea at his near post to finish off a fast counter attack.
Both teams had entered the match at the Stade the Bordeaux guaranteed a spot in the knockout stage. However, both teams wanted to win especially as the runner-up in the group meets Italy.
Croatia's surprise victory came despite playing without star midfielder Luka Modric and forward Mario Mandzukic, both out with muscle injuries.
Spain was at full strength despite having already qualified, playing with the same 11 that won its first two group games.
The result ended Spain's 14-game unbeaten streak at the European Championship over two tournaments. It also ended the team's run of seven straight games without conceding a goal. The last time it had conceded was in a 1-1 draw against Italy in its first match in the 2012 tournament, 734 minutes ago.
Croatia hadn't beaten Spain since a 2-0 result in friendly in Valencia in 1994. The teams had also met in the final group game at Euro 2012, when La Roja ran out 1-0 winners.
Tales Azzoni on Twitter: http://twitter.com/tazzoni. His work can be found at http://bigstory.ap.org/content/tales-azzoni