Georgios Samaras' last-gasp penalty saw Greece beat Ivory Coast 2-1 and reach the FIFA World Cup's last 16 for the first time.
Needing a win to qualify in Fortaleza on Tuesday, Greece left it late, with Samaras' 93rd-minute spot-kick sealing their progression from Group C in dramatic circumstances.
The penalty was given after the forward was tripped by Giovanni Sio and the Celtic man dusted himself down before scoring to Boubacar Barry's left.
A draw would have been enough for Ivory Coast to progress and that looked likely when Wilfried Bony came off the bench to level proceedings with 16 minutes left.
Greece had initially taken the lead through Andreas Samaris – an early replacement for the injured Panagiotis Kone – in the 42nd minute.
They had also hit the bar earlier, through Jose Holebas, and the woodwork was to deny them again in the second half as Giorgos Karagounis saw his 35-yard strike bounce away to safety.
But Greece claimed a deserved win as Samaras kept his nerve, setting up a clash with Costa Rica in the round of 16.
Yaya and Kolo Toure both started, after deciding to stay in Brazil following the death of their brother, while captain Didier Drogba made his first start of the tournament, replacing Bony.
Greece's start was thrown into disarray by two forced substitutions inside the first 30 minutes, as Kone and goalkeeper Orestis Karnezis suffered injuries.
But they almost took the lead in the 33rd minute from a quick break, as Holebas – played in following Samaras' well-weighted through-ball – saw his fierce strike come back off the crossbar.
The goal frame did not come to the rescue of Barry nine minutes later, though.
A stray pass from Cheick Tiote saw Samaris pounce, and he combined well with Samaras before coolly slotting past the goalkeeper.
Ivory Coast continued to control possession, but failed to convert it into regular chances, as their opponents looked more decisive in attack.
Greece's threat on the counter only grew as the second half progressed and Ivory Coast were rescued by the bar for a second time with 22 minutes to go, when captain Karagounis tried his luck from 35 yards.
The introduction of Bony gave Ivory Coast another dimension and after wasting a pair of half-chances, the Swansea City forward drew his side level, producing a composed first-time finish after Gervinho's clever cut-back.
But it was the Greeks who looked more likely to score the winner, as Dimitrios Salpingidis flashed an effort wide, before Sio's foul gave Samaras the chance to be a hero.
And it was an opportunity he took with both hands, slotting past Barry to earn Fernando Santos' side a place in the next round.
|Coach: Fernando Santos|
for P. Kone 12'
for O. Karnezis 24'
for G. Karagounis 78'
|Uncapped Lee named in South Korea squad|
|Gutierrez makes Newcastle comeback|
|Ji to rejoin Augsburg from Dortmund|
|Holders ES Setif learn Champions League fate|
|Kraft extends Hertha deal|
|FIFA reform process ongoing - Blatter|
|Walsh: Leicester should stick with Pearson|
|Hodgson optimistic for England´s future|
|Milan chief Galliani targets Champions League|
|Hull recall Ince and Figueroa|
|Stranzl extends Gladbach stay|
|Redknapp not ruling out Morrison return|
|Barnes hopeful of keeping his place|
|Lambert hails ´outstanding´ Okore|
|Kramer pens Leverkusen extension|
|Lacazette will not rest on laurels|
|Hughes: Chelsea can win quadruple|
|Ramos: No rush on contract talks|
|Johnson: Derby winner one of my finest hours|
|Liverpool are turning the corner - Lallana|
|Juan credits Mancini for Inter revival|
|Allardyce eyeing London derby success|
|Juanfran targets new-year push|
|Long slams Southampton critics|
|Guidetti out, Griffiths in hints Deila|
|Spurs forward Kane targets 20 goals|
|Lyon fitness key to Bordeaux thrashing - Fournier|
|Santa Fe 1 Medellin 1 (agg 3-2): Hosts win Clausura title|
|Emelec 3 Barcelona 0 (4-1 agg): Bolanos brace seals title defence|
|Pioli: Lazio did not switch off|
|No Park in South Korea´s Asian Cup squad|
|Gignac: Marseille lead ´a huge boost´|
|Simeone applauds Griezmann´s hat-trick|
|Redknapp vows to keep QPR sharpshooter Austin|
|Santiago Wanderers 1 Palestino 6 (agg 2-9): 36-year drought ends for visitors|
|Juan Aurich 2 Sporting Cristal 3 (aet, agg 4-5): Chavez hands visitors Peruvian title|
|Liga del Futbol Profesional Boliviano Review: Bolivar win title|
|Mancini plays down Lennon transfer rumours|
|Ligue 1 Review: Marseille end 2014 top of the table, Lyon leapfrog PSG|
|Kovacic has mixed emotions after Inter draw|
|Serie A Review: Lazio go third despite Inter rally, Sampdoria held|
|La Liga Review: Griezmann the man for Atleti, Villarreal gain fifth straight win|
|Primeira Liga Review: Benfica win six straight|
|Athletic Bilbao 1 Atletico Madrid 4: Griezmann hat-trick seals comeback win|
|Inter 2 Lazio 2: Hosts rally to claim draw|
|McCoist makes Rangers exit|
|Sturridge on course for January return - Rodgers|
|Liverpool getting back on track, says Rodgers|
|Wenger bemoans failure to defend set-pieces|
|Bundesliga Review: Hoffenheim enjoy big win, Freiburg falter late on|
|Zorc: Dortmund to stick with Klopp|
|Liverpool 2 Arsenal 2: Bandaged Skrtel rescues a draw|
|I have no problem with Payet, insists Bielsa|
|Eredivisie Review: Ajax leave it late, Vitesse finally win|
|Pardew rues over-zealous Newcastle approach|
|Benitez hopeful ahead of Supercoppa|
|I nearly took Johnson off - Poyet|
|Johnson revels in derby late show|
|Juventus must maintain focus, warns Allegri|
|Newcastle United 0 Sunderland 1: Johnson settles derby|
|Carlos leaves Sivasspor post|
|Dundee United 2 Celtic 1: Ciftci inspires surprise win|
|Mourinho against use of independent panels|
|Hartlepool not interested in signing Evans|
|Reed delighted with first Southampton start|
|Bremen agree Oztunali loan|
|Irvine backs Ideye to end goal drought|
|Carrick backs Falcao to kick on|
|Dortmund will come back stronger, vows Klopp|
|Bojan senior slams Barcelona|
|Eredvisie title not won yet - Depay|
|Sterling eager to catch Arsenal cold|
|Monk: Ki will be sorely missed|
|Bruce looking to recall Hull duo from loan spells|
|Allardyce: Pearson deserves time|
|Sydney 0 Wellington Phoenix 2: Burns at the double|
|Real Madrid 2 San Lorenzo 0: Spanish giants complete triumphant 2014|
|McCoist: Departures sucking life out of Rangers|
|Hargreaves urges Sterling to stay put|
|Herediano 1 Deportivo Saprissa 1 (agg 3-5): Draw hands visitors consecutive titles|
|Tribulietx basks in Auckland City´s heroics|
|San Lorenzo´s Bauza applauds Ancelotti|
|Wenger: Sanchez a Footballer of the Year candidate|
|Chelsea like United´s treble-winning team - Hargreaves|
|Ancelotti: Copa del Rey victory inspired Real´s stunning run|
|La Liga Review: Catalan clubs triumph|
|Milan on right track - Inzaghi|
|Estoril 1 Vitoria Guimaraes 0: Kleber checks visitors´ momentum|
|Eredivisie Review: PSV in Eagles demolition, AZ downed at home|
|Garcia fumes at missed handball|
|Serie A Review: 10-man Milan frustrate Roma, Cesena rescue point|
|Roma 0 Milan 0: Hosts denied despite Armero red|
|Ligue 1 Review: PSG held at home, Monaco claim fourth win in a row|
|Bundesliga Review: Bremen off bottom with Dortmund win, Augsburg beat Gladbach|
|Blanc frustrated after drab stalemate|
|League Two Review: Moore´s Hartlepool tenure begins with draw|
|Championship Review: Blackpool hit for six, Middlesbrough slip up|
|Luis Enrique enjoying Pedro´s resurgence|
|Scottish Premiership Review: Aberdeen move to second, St Mirren misery continues|
|Koeman delighted with clinical Southampton|
|Pochettino tips in-form Kane for England call-up|
|Dortmund are ´idiots´ - Klopp|
|Allardyce hails ´outstanding´ Downing|
|Young admitted fault after Agbonlahor dismissal, says Lambert|
|Pearson not concerned with speculation|
|Bruce: Hull simply not good enough|
|Everton must improve - Martinez|
|Irvine rues sloppy defending|
|Cruz Azul 1 Auckland City 1 (2-4 on pens): Plucky New Zealanders claim third|
|Austin an example for young strikers - Redknapp|
|Dyche takes pride in White Hart Lane defeat|
|Arabian Gulf League Review: Al Shabab strike late to sink Al Dhafra, top two win|
|Swansea win vindicated changes, says Monk|
|Van Gaal frustrated by dropped points at Villa|
|Paris Saint-Germain 0 Montpellier 0: Champions frustrated by Courbis´ men|
|League One Review: Wilson gains landmark win as Bristol City and Swindon falter|
|Hull City 0 Swansea City 1: Monk´s men celebrate rare away win|
|Southampton 3 Everton 0: Koeman´s side back to winning ways|
|Aston Villa 1 Manchester United 1: Visitors held despite Agbonlahor dismissal|
|QPR 3 West Brom 2: Austin treble lifts hosts out of drop zone|
|Barcelona 5 Cordoba 0: Suarez opens Liga account in emphatic win|
|Tottenham 2 Burnley 1: Lamela stunner wins it for Spurs|
|West Ham 2 Leicester City 0: Carroll, Downing seal the points|
|Werder Bremen 2 Borussia Dortmund 1: Hosts off the bottom by adding to Klopp´s woes|
|Kerala Blasters 0 Atletico de Kolkata 1: Last-gasp Rafique seals inaugural title|
|Warnock fumes over disallowed goal|
|Pellegrini hails Silva quality|
|Betis announce Mel return|
|Huntelaar signs Schalke extension|
|Juventus v Napoli: Allegri backs Tevez to make difference|
|Stoke City v Chelsea: Mourinho calls for adaptability|
|Manchester City 3 Crystal Palace 0: Silva strikes twice as champions go joint-top|
|A-League Review: City snatch Melbourne derby honours, Glory pull further clear|
|Mancini: Inter can finish third|
|Sterling revels in Golden Boy award|
|Pellegrini: You never win a title in December|
|Rodgers bemoans Sanchez snub|
|Ayew confident Marseille can beat title rivals|
|Mercier: San Lorenzo won´t roll over to Real Madrid|
|Lukaku: I´m still 21|
|Mainz bemoan ´tragic´ loss to Bayern|
|Rojo ruled out for Villa trip|
|Lopetegui thrilled with Porto response|