Spain will play Italy in the last 16 of Euro 2016 after a late Croatia winner at the Nouveau Stade in Bordeaux today condemned them to second place in Group D.
Spain took the lead when Cesc Fabregas dinked the ball over keeper Danijel Subasic and Alvaro Morata tapped in.
An Ivan Rakitic lob hit the woodwork for Croatia, who equalised when Nikola Kalinic turned in Ivan Perisic’s cross.
Subasic saved a Sergio Ramos penalty and Perisic’s late winner gave Croatia, who finished top of the group, a tie against a third-placed qualifier.
Perisic lashed in an 87th-minute shot in a thrilling match to inflict Spain’s first defeat in 15 games at the European Championship since losing to Portugal in Euro 2004.
Croatia will now play on Saturday in Lens, while Spain’s mouth-watering tie against Italy will take place on Monday in Paris.
At the Stade Velodrome, Poland reached the knockout stages of a European Championship for the first time as they finished second in Group C after a 1-0 win over Ukraine.
Arkadiusz Milik had a shot saved and Robert Lewandowski sent an effort over as Poland missed two early chances.
Ukraine, who were already out, went close when Andriy Yarmolenko shot wide.
Jakub Blaszczykowski curled in a left-foot shot for the winner after 54 minutes and Poland will now play Switzerland in the last 16 on Saturday.
However, Bartosz Kapustka will miss the match in Saint-Etienne after picking up his second yellow card of the tournament.
Meanwhile Turkey kept alive their faint hopes of reaching the last 16 of Euro 2016 and eliminated the Czech Republic with a hard-fought 2-0 victory at Stade Felix Bollaert-Delelis in Lens.
The result guarantees Northern Ireland go through, while Turkey must wait until Wednesday to learn their fate.
A neat finish from Burak Yilmaz put them ahead, prompting Czech pressure which saw Tomas Sivok hit the post.
Volkan Babacan made a string of saves before Ozan Tufan smashed in from 10 yards to move Turkey third in Group D.
Fatih Terim’s side and Albania in Group A are vulnerable on three points and results on Wednesday could see a host of countries in Group E and Group F replace them to qualify as one of the best third-place finishers.
Turkey had not scored in the tournament before Tuesday’s match, but they looked revitalised in northern France and knew that with each goal they scored, their goal difference and hopes of a continued stay improved.
They looked a lot more like the team who arrived at Euro 2016 with just one loss – to England – in 16 matches, and they bravely soaked up what the Czechs threw at them to inflict a defeat which could be the last action of Arsenal goalkeeper Petr Cech’s international career.
At Parc des Princes, Northern Ireland were beaten by world champions Germany but still advanced to the last 16 of Euro 2016 after the Czech Republic’s 2-0 defeat by Turkey.
Germany wasted several chances before and after Mario Gomez scored the game’s only goal in Paris.
The Czechs’ loss meant Northern Ireland go through as one of four best third-placed teams as they have a better record than Albania and Turkey.
Michael O’Neill’s side will face Wales or hosts France in the last 16.
Northern Ireland finished the group stage with three points, the same number as Albania and Turkey, but boast a better goal difference than their rivals.
They have reached the knockout stages of a major tournament for just the third time in their history.