Two-time reigning European champion Spain was stunned by Croatia and will play Italy in the round of 16 after falling 2-1 in the Group D finale on Tuesday.
Spain gave up a 1-0 lead and was in position to re-take the lead through Sergio Ramos's penalty kick, but Danijel Subasic made the save, and Ivan Perisic scored the 87th-minute winner to lift Croatia into first place. Spain, which hadn't conceded a goal in a European Championship since the opening game of the 2012 edition, finishes second as a result.
Alvaro Morata scored his third goal of the competition to tie Gareth Bale atop the Golden Boot race to open the scoring.
Morata finished off a brilliant passing sequence, with David Silva setting up Cesc Fabregas, who crossed for Morata. The forward, who Real Madrid announced will return to the Spanish capital from Juventus next season, tapped home to score in the seventh minute:
Nikola Kalinic brought Croatia level just before halftime with an expert finish by the near post. Croatia, which was playing without injured Real Madrid midfielder Luka Modric:
Sergio Ramos had a chance to give Spain the lead, but he had his penalty kick saved by Danijel Subasic in the 72nd minute. Subasic appeared to be well of his line before Ramos struck his PK, but nothing was called:
Croatia then took the lead late through Perisic and held on for the landmark victory:
Not only will Spain have to play Italy first in the knockout stage, but Germany, France and England are all also on that side of the bracket. Turkey pipped Czech Republic for third and remains in contention for the knockout stage.
For up-to-the-minute Euro 2016 standings, schedules and statistics, go to our tournament home.