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'
|Gutierrez, Taylor released by Newcastle|
|Figo calls on re-elected Blatter to resign after ´dark day´ for football|
|Szczesny blasts father over ´idiotic´ comments|
|Blatter vows to leave ´strong´ FIFA|
|Blatter re-elected as FIFA president|
|BREAKING NEWS: FIFA elections set for second round of voting|
|Atsu wings in for Bournemouth campaign|
|Klopp: Pokal final not about me|
|Clement says Real goodbyes|
|Inter v Empoli: Icardi looking for final flourish|
|BREAKING NEWS: Blatter - I will fix FIFA|
|Northern Ireland v Qatar: O´Neill keen to prepare for Romania test|
|Palestine drop proposal for Israel suspension|
|Suarez will only get better, warns Iniesta|
|Martinez keen to recruit quickly|
|Monk keen to build on successful Swansea campaign|
|Fit-again Suarez set to aid Barca´s treble quest|
|Anonymous ´bomb´ threat received at FIFA Congress|
|Qatar organisers insist World Cup bid met ´highest ethical standards´|
|Wilkinson and Sorensen leave Stoke|
|Blatter: You can´t ask everyone to behave ethically just like that|
|Van Bronckhorst positive about Feyenoord future|
|Australian police to look into FFA-Warner dealings|
|Dardai signs Hertha deal|
|Protester interrupts FIFA Congress|
|Spurs complete Wimmer signing|
|Warner questions charges following release|
|Mexico v Guatemala: Herrera´s men kick off Copa preparations|
|New Zealand no longer supporting Blatter|
|´Post-World Cup trauma´ affected Mertesacker|
|Racing Club 0 Guarani 0 (0-1 agg): Draw sees Paraguayans through|
|Hamburg shocked by Karlsruher attack - Labbadia|
|Serie A Preview: Napoli, Lazio eye Champions League|
|Hodgson will not overstay England welcome|
|Scholes: United must keep Di Maria|
|Leyton Orient appoint Hendon|
|Benteke has a buy-out clause - Sherwood|
|US Soccer will support Prince Ali in FIFA election|
|Dynamo disappointed with officials after City friendly abandoned|
|Calls for Suarez appeal gather momentum|
|Eredvisie Review: Vitesse denied by late Uth goal, NAC Breda boost survival hopes|
|Rangers 1 Motherwell 3: McCall´s men facing uphill struggle|
|Hamburg 1 Karlsruher 1: Bundesliga side escape with draw|
|Blatter vows to lead FIFA clear of trouble as corruption scandal rolls on|
|Bundesliga: Bayern Munich season review - League crown not enough to signal successful campaign|
|Genoa forced to wait for UEFA licence|
|Injured Cardozo out of Paraguay squad|
|CONCACAF provisionally dismisses Webb and Li|
|Klopp: Career highlights of a charismatic coach|
|Verona v Juventus: Ogbonna seeks strong Champions League warm-up|
|FA charges Demetriou over betting breaches|
|Atalanta v Milan: Inzaghi faces last chance to prove worth|
|King joins Bournemouth as QPR rebuild begins|
|Plymouth part ways with Sheridan|
|Hernandez banned for three matches|
|Chelsea star Fabregas has nose surgery|
|Blatter: More bad news may follow|
|Galliani hopeful over Ancelotti deal|
|Frontzeck to continue as Hannover coach|
|Tremmel released as Tate waves goodbye to Swansea|
|Arsenal v Aston Villa: Sherwood out to upset holders|
|UEFA open to boycott of World Cup - Platini|
|Porto activate release clause for Casemiro|
|Athletic Bilbao v Barcelona: Catalans seeking second leg of treble|
|Auxerre v Paris Saint-Germain: History beckons for Ligue 1 champions|
|Cole confirms West Ham departure|
|UEFA elect not to boycott FIFA Congress|
|Borussia Dortmund v Wolfsburg: Klopp aiming for triumphant farewell|
|Flamini hails Coquelin impact at Arsenal|
|South Africa deny wrongdoing in World Cup bid|
|Benitez confirms Napoli exit|
|McShane among six released by Hull|
|Cerci committed to Milan|
|West Ham expect Collins to return for pre-season|
|Real deny Pogba bid|
|Important to keep Chelsea squad together - Mourinho|
|Alonso: Gerrard was magic|
|Pochettino silent on Ings speculation|
|Visa threatens to ´reassess´ sponsorship amid FIFA scandal|
|Blatter skips FIFA Medical Conference|
|MLS Preview: Revs not out for revenge against Galaxy|
|MLS Review: Sounders go top in West, Timbers and Galaxy win|
|AFC stands by Blatter|
|Matheus ´alright´ after collapse - Markevych|
|Copa Libertadores Review: River, Inter through to semis|
|Signing Toni a ´long shot´ for Adelaide|
|Ramsey good enough for Barca - Coleman|
|Bacuna pushing for Benteke stay|
|Evans stunner settles City friendly in Toronto|
|Banega: Emery a great coach|
|Emery tight-lipped on Sevilla future|
|Argentina finalise Copa America squad|
|Nike issues statement following arrest of FIFA officials|