Ivory Coast failed to reach the last-16 of the Fifa World Cup for the third time in a row, as Greece snatched a 2-1 win in stoppage time of their final Group C clash in Fortaleza.
Andreas Samaris pulled the 2004 European champions ahead three minutes to the interval, but Wilfried Bony slotted home a second-half equaliser.
The Elephants looked bound for the knock-out phase before Giorgios Samaras smashed past goalkeeper Boubacar Barry a last-minute penalty after the Celtic winger was tripped inside the box by Chieck Tiote.
Coach Sabri Lamouchi’s men were on the brink of ending their World Cup under-achievers title when Swansea’s Bony coolly tapped home a Gervinho assist, after struggling for 31 minutes, to level Samaris’ opener.
But the late twist means Greece advance into the second round with Colombia, who despite progressing with a game to spare, thrashed Japan 4-1 in Cuiaba to record maximum nine points.
Colombia face Group D runners-up Uruguay, while Greece will be up against Costa Rica in the next round.