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'
|Hull sweating over McGregor fitness|
|Montella eager to land midfielder|
|Hull see Rhodes bids rejected|
|Balotelli talks have lasted three months - agent|
|Irwin backs Van Gaal to succeed at United|
|Cattermole ready for United test|
|Cahill confident of Chelsea success|
|Sherwood turned off by Palace´s lack of interest|
|Wenger wants Arsenal to atone Goodison thrashing|
|Ancelotti: Khedira free to leave|
|FC Dallas 2 Real Salt Lake 1: Hosts leapfrog RSL into second|
|Hughes warns suitors off Begovic|
|Supercopa a ´proud´ moment, says Simeone|
|Ancelotti: We did not need Di Maria|
|Koke hails new arrivals|
|Sluggish Monaco not fazing Berbatov|
|Recovery will take time, says Van Gaal|
|Atletico Madrid 1 Real Madrid 0 (2-1 agg): Mandzukic secures Supercopa|
|Guardiola satisfied with three points|
|Vitoria Guimaraes 3 Penafiel 0: Mensah brace inspires victory|
|Blanc has no worries despite Evian stalemate|
|Bayern Munich 2 Wolfsburg 1:Pep´s men kick off with a win|
|Heracles 0 Cambuur 1: Last-gasp defeat for pointless Heracles|
|Evian 0 Paris Saint-Germain 0: Cabaye sees red as champions frustrated|
|Al Hilal Omdurman 2 Zamalek 1: Al Madina ensures hosts of victory|
|McLeish returns to management with Genk|
|Mackay defends Bevan over controversy|
|Milan dealt blow in search for Balotelli replacement|
|Sunderland v Manchester United: Van Persie returns in much-needed boost|
|Depay agrees PSV contract extension|
|Barcelona v Elche: Confidence flows as Luis Enrique era dawns|
|N´Diaye leaves Sunderland for Betis|
|Dortmund can challenge Bayern - Hitzfeld|
|Van Gaal ´enchanted´ by Rojo|
|Tottenham v QPR: Redknapp returns to White Hart Lane|
|Hughes unaware of Palacios interest|
|Hull City v Stoke City: Visitors keen to spoil party|
|Hannover seal Briand deal|
|Emery braced for Fazio departure|
|Rodgers coy on Balotelli speculation|
|Xavi out to feel ´useful´ at Barca|
|Cardiff call for Bevan resignation|
|Mourinho: Club takes priority over players|
|Pellegrini ready for crucial Liverpool clash|
|Retirement not on Buffon´s radar|
|Swansea loan Carroll from Spurs|
|Taylor wants Liberty to become a fortress|
|Celtic enter Scepovic race|
|Samaras signs two-year deal at Albion|
|We cannot be complacent - Marcelino|
|Redknapp: Mackay should get second chance|
|LMA apologise for initial Mackay statement|
|Neymar a doubt for Elche clash|
|Alves confident of Enrique evolution|
|Ferdinand dreaming of England job|
|European and EPL clubs circling for Jets|
|Millen ready to lead Palace recruitment|
|Wenger: Wilshere should ignore critics|
|CONCACAF Champions League Review: Herediano start strongly|
|Lambert excited by ´big asset´ Cole|
|Copa Sudamericana Review: Barcelona, Deportivo Capiata in the box seat|
|Brazilian Serie A Review: Luciano inspires Corinthians, Cruzeiro extend lead|
|Blanc: Di Maria transfer difficult|
|Klopp eager to deny Leverkusen|
|Blanc optimistic over Ibrahimovic fitness|
|Tiote will stay - Pardew|
|Bruce laments ´stupid´ McGregor mistake|
|UEFA Europa League Review: Tottenham in late turnaround, Astra shock Lyon|
|League Two Preview: Morecambe, Burton out to continue fast starts|
|Sassuolo 4 Cittadella 1: Second-half rally sees Sassuolo into Coppa fourth round|
|Howard to take US sabbatical|
|Lokeren 1 Hull City 0: McGregor error gifts Belgians victory|
|Rwanda given Wednesday hearing for disqualification appeal|
|Pochettino hails substitutes´ impact|
|Mackay apologises over text message scandal|
|Brandao suspended over Motta incident|
|Borussia Dortmund v Bayer Leverkusen: Klopp expecting tough start|
|QPR complete loan deal for Vargas|
|League One Preview: Fleetwood, Preston face home tests|
|Chelsea v Leicester City: Schurrle expecting Chelsea improvement|
|Southampton v West Brom: Koeman wary of Albion|
|AEL 1 Tottenham 2: Late turnaround gives visitors play-off edge|
|CAF Confederation Cup: Al Ahly, Nkana out to reach last four|
|Swansea City v Burnley: Monk expecting stern examination|
|Bender close to Leverkusen return|
|Morocco will host Club World Cup despite Ebola concerns - FIFA|
|Schneiderlin not allowed to leave, insists Koeman|
|Dyche confident Burnley can strengthen|
|West Brom eye Samaras signing|
|Aston Villa v Newcastle United: Lambert wants more Weimann goals|
|MLS Preview: Sounders look to bounce back at Portland, Johnson banned for DC|
|Klose eyes European football|
|Monk warns Swansea over complacency|
|De Jong set for Newcastle return|
|Crystal Palace v West Ham: No excuses from Millen|
|Pearson looking for Chelsea indication|
|Blanc wants Rabiot to stay|
|Bowyer reveals Hull approach for Rhodes|
|Atletico out to gatecrash Barca, Real party once again|
|Barcelona go back to the future|
|CSL Preview: Beijing Guoan, Dalian Aerbin hit the road|
|Westwood returns to Ireland squad|
|Millen confident on Palace job prospects|
|Pedro struck down by gastroenteritis|
|Championship Preview: Magath preaches patience, Ipswich host East Anglian derby|
|Ribery not ready for Bayern return - Guardiola|
|Ancelotti: Di Maria has asked to leave|
|Moody resigns from Palace post|
|Everton v Arsenal: Martinez denies Everton have advantage|
|Coventry agree Ricoh return|
|Allardyce eyes defensive improvements|
|FA to investigate Cardiff dossier|
|Simeone not expecting to retain title|
|Balotelli bids farewell to Milan team-mates|
|Wenger open to signings after Arteta blow|
|Martinez to wait on Kone, Oviedo before considering late signings|
|Ocampos believes in Jardim´s methods|
|Villas-Boas calls for Zenit focus|
|Jovetic predicts bright future at City|
|Hamren hoping for quick Ibrahimovic recovery|
|Van Gaal retains focus on team ethic|
|Martinez calls for Everton consistency|
|Oxlade-Chamberlain: Arsenal´s best will come|
|Benaglio retires from Swiss duty|
|MLS Review: Galaxy stun Rapids, Sounders held|
|CONCACAF Champions League Review: MLS clubs shine|
|Panama 4 Cuba 0: Hosts finally win|
|K. League Preview: In-form Jeonbuk out to increase advantage|
|Copa Sudamericana Review: Penarol poised to advance, General Diaz on track|
|Liga MX Preview: America target another win|
|J.League Preview: In-form Kashima, Tokyo face tests|
|Fresh faces in Australia squad|
|Copa Argentina Review: River Plate, Estudiantes des Caseros reach quarters|
|Girard rues wasteful Lille|
|Scholes: ´I am scared for United´|
|Patient Inter got just rewards - Mazzarri|
|UEFA Europa League Review: Inter win in Iceland|