Croatia condemned Spain to their first European Championship defeat in 12 years as a 2-1 victory sent them into Euro 2016’s last 16 as Group D winners.

Ivan Perisic was the tournament’s latest last-gasp hero, marking his 50th cap with a virtuoso performance and an 87th- minute winner that means double-defending champions Spain will play Italy in the next round, having fallen to their first defeat in this tournament since a 1-0 reverse to Portugal at Euro 2004.

Both sides knew they would go through before kick-off, and the lack of tension made for an entertaining contest.

Alvaro Morata’s return to Real Madrid had been confirmed earlier on Tuesday and the striker opened the scoring after just seven minutes, but Nikola Kalinic netted the first goal Vicente del Bosque’s side had conceded in 735 minutes of European Championship action to level the scores before half-time.

Spain captain Sergio Ramos – who became his country’s most-capped outfield player on his 134th appearance – had a second-half penalty saved, but they rarely looked anywhere near their best and Perisic scored a breathtaking goal in the closing stages.

Turkey remain in with a chance of reaching the last 16 of Euro 2016 after securing an impressive 2-0 win over Czech Republic in Lens on Tuesday.

Fatih Terim’s side came into their final Group D encounter without a goal or point to their name, but victory thanks to strikes from Burak Yilmaz and Ozan Tufan lifted them above their opponents and into contention for one of the third- place qualification berths.

By contrast, Czech Republic, missing talisman Tomas Rosicky through injury, are eliminated with their stirring late fightback to earn a 2-2 draw against Croatia last time out ultimately counting for nothing.

The opener arrived in the 10th minute as Burak applied the decisive touch to a sweeping Turkey move with a fine finish, before Tufan smashed home to double the lead midway through the second half.