Portugal have fallen to a second-placed finish in Group B after a controversial penalty decision handed Iran an equaliser late on in a 1-1 draw in the Mordovia Arena, as Spain held onto first place with a 2-2 draw against Morocco.
The European champions, who will now face Uruguay in the Round of 16, struggled to break Carlos Queiroz's side down before Ricardo Quaresma's moment of magic on the brink of half-time promised to be the decider throughout the encounter.
A late penalty stole the show, however, converted by Karim Ansarifard, with the referee coming to a controversial conclusion when reviewing footage from VAR, as the two nations shared a point each.