Northern Ireland lost 1-0 to Germany but were celebrating a few hours later after Turkey's 2-0 win over Czech Republic meant they were assured of being among the best four third placed teams and will face either hosts France or Wales in the round of 16.
Northern Ireland finished third in their group on three points but with a better goal difference than Turkey and Albania, who finished third in their respective groups.
It also meant that Slovakia and Hungary, who have four points, are guaranteed to be at least be among the best four third-placed finishers.
Croatia were also assured of progress by that result but went on to secure top place in Group D by beating Spain 2-1 and will play one of the third-placed teams.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Spain will now face Italy, winners of Group E, and are in the same half of the draw as Germany and England.
With two sets of group matches still to be played on Wednesday, Turkey and Albania, both on three points, will have to wait to see if results go their way.
(Reporting by Julien Pretot; Editing by Brian Homewood)
