England will meet Iceland, the least populous nation ever to qualify for the tournament, in the last 16 of Euro 2016 after an extraordinary final round of matches in Group F.
A Cristiano Ronaldo-inspired Portugal looked to have secured second place in the group – and a clash with Roy Hodgson's team in Nice on Monday night – by coming from behind three times to draw 3-3 with Hungary.
But a 94th-minute goal from Arnor Ingvi Traustason gave Iceland a 2-1 win over Austria and ensured they finished runners-up behind Hungary.
The drama spared England a daunting reunion with Portugal, who eliminated them from both Euro 2004 and the 2006 World Cup in painful penalty shoot-outs.
England have only played Iceland twice ever, winning 6-1 in their most recent meeting shortly before this tournament 12 years ago and drawing the other match in 1982.
Current Three Lions skipper Wayne Rooney scored twice in the 2004 friendly, whiole Iceland were captained that day byb Eidur Gudjohnsen, the veteran fromer Chelsea and Barcelona star who is still part of their squad, aged 37.
Iceland upset former European champions Holland on their way to qualifying for the finals in France, despite having a population of fewer than 330,000 people.
Portugal's repeated comebacks, which featured two goals from Ronaldo, were not in vain as they ensured they would qualify for the last 16 as one of the best third-place teams.
The line-up for the first knockout round will be finalised this evening when Group E concludes.