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'
|Furious Mancini slams Inter´s ´worst ever´ first half against Lazio|
|Serie A Review: Champions League places locked, Milan play out six-goal thriller|
|La Liga Review: Villarreal secure Champions League return|
|Lazio 2 Inter 0: Champions League race comes to a Klose|
|Koeman delivers Pelle warning|
|Morata wants to stay at Juventus, claims Marotta|
|Pellegrini disappointed with City defending in defeat|
|Iheanacho: City will bounce back from Saints defeat|
|´On fire´ Mane salutes Southampton show|
|Angers 0 Marseille 1: Batshuayi strike secures Ligue 1 status|
|Southampton 4 Manchester City 2: Mane hat-trick blows top-four race open|
|Van Gaal calls for video referees after Drinkwater decision|
|Schmeichel: I don´t care how we win it|
|Montella open to Italy role|
|Brocchi pleased with Milan fightback|
|Van Gaal defends ´human´ Fellaini over Huth elbow clash|
|Ronaldo wants Zidane to stay at Madrid|
|Ranieri to miss decisive Tottenham clash|
|Rooney disappointed after Leicester draw dents top-four hopes|
|Bayern Munich v Atletico Madrid: Hosts seek to vent Bundesliga frustration|
|Leicester captain Morgan hails battling Old Trafford point|
|AC Milan 3-3 Frosinone: Menez penalty denies strugglers|
|Klopp not concerned by Sturridge behaviour|
|Manchester United 1 Leicester City 1: Captain Morgan on target as Foxes edge closer to glory|
|Allofs: We do not have the same weapons as Bayern|
|Guidolin coy on Swansea future|
|Allegri happy with win after title celebrations|
|Umtiti flattered by Tottenham interest|
|Klopp frustrated by lacklustre Liverpool|
|Hannover mourn Feierabend|
|Godin, Carrasco fit for Bayern clash|
|Swansea City 3 Liverpool 1: Ayew double punishes wasteful visitors|
|Dybala claims Messi, Ronaldo would score less in Italy|
|Juventus 2 Carpi 0: Hernanes, Zaza on target as champions march on|
|Ronaldo back in training for Madrid|
|Barcelona confirm Bravo calf injury|
|Aulas brands Ligue 1 ´championship of Qatar´|
|Leicester City at Manchester United: Aiming for Hollywood ending to title push|
|I can start for England at Euro 2016 - Sturridge|
|Dybala never doubted Juventus|
|Aguero celebrates brother´s Independiente debut|
|Sturridge rounds on critics, plays down Klopp rift|
|Adelaide United 3 Western Sydney Wanderers 1: Reds seal maiden A-League title|
|Eriksson: Simeone is an example to follow|
|´Where am I?´ - Lovren reveals travel struggles|
|´If I have to leave Bayern, then I will´ - Benatia|
|Walker ´over the moon´ after Pochettino agrees new deal|
|MLS Review: Villa leads City, Impact held|
|We´d probably be relegated without Defoe – Allardyce|
|Koeman: Leicester will do well in Champions League|
|Ronaldo needs rest or could miss Euros - doctor|
|United shaped me as a player - Schlupp|
|Sanchez, Vidal lead Chile´s Copa squad|
|Arsenal´s patience paid off - Cech|
|I will know Madrid´s plans - Pellegrini|
|Granada 3 Las Palmas 2: Superb comeback boosts hosts´ survival hopes|
|Martinez pleased with impact of new faces|
|Ligue 1 Review: Lyon, Monaco continue fight for second|
|Serie A Review: Fiorentina frustrated, Torino hit five|
|Barca keeper Bravo set for tests on calf strain|
|Barca will not rely on rivals slipping up - Luis Enrique|
|Simeone: I am not a fortune teller|
|Neil defiant in defeat|
|Real Betis 0 Barcelona 2: Rakitic and Suarez edge champions back ahead in title race|
|´Protests more like disappointed love´ - Wenger sorry he cannot keep Arsenal fans happy|
|Bundesliga Review: Monchengladbach and Dortmund delay Bayern´s title party|
|Arsenal should be doing better, concedes match-winner Welbeck|
|Black wants Villa display to build bridges|
|Tuchel: Hummels abuse went too far|
|Flores laments mixed Hornets performance|
|Scottish Premiership Review: Celtic made to wait by Aberdeen|
|Ribery a doubt for Bayern´s crunch Atletico clash|
|Arsenal 1 Norwich City 0: Substitute Welbeck boosts under-fire Wenger|
|Allardyce rues Sunderland nerves after Stoke draw|
|Atletico Madrid 1 Rayo Vallecano 0: Griezmann maintains title momentum|
|Benitez salutes Newcastle ´heroes´ Townsend and Darlow|
|Hughes disappointed by Sunderland penalty call|
|Football League Review: Wigan confirm promotion to Championship|
|Bilic confident of Europe after West Brom win|
|Howe defends players´ efforts after form slump|
|Bale can match Ronaldo´s run - Zidane|
|Watford poor in Villa win, concedes Deeney|
|Hummels slams ´nonsense´ claims over Bayern request|
|Zidane hopeful on Ronaldo, Benzema as Madrid give backing to medics|
|Pardew rues Cabaye penalty miss in defeat to Newcastle|
|West Brom did not get the breaks - Pulis|
|Fan protests of no concern to Martinez|
|Ramos urges Real Madrid to ´fight to the end´|
|Defoe: You haven´t got a choice, I had to score|
|Watford 3 Aston Villa 2: Late Deeney double sinks Villa|
|Stoke City 1 Sunderland 1: Defoe snatches point but Allardyce´s men slip into bottom three|
|Real Sociedad 0 Real Madrid 1: Late Bale winner keeps title challenge alive|
|West Brom 0 West Ham 3: Noble brace boosts European hopes|
|Newcastle United 1 Crystal Palace 0: Townsend, Darlow heroics boost Benitez|
|Everton 2 AFC Bournemouth 1: Baines strike eases pressure on Martinez|
|Leno to stay at Leverkusen after buyout clause expires|
|Bayern Munich 1 Borussia Monchengladbach 1: Hahn puts title celebrations on hold|
|Borussia Dortmund 5 Wolfsburg 1: Fans round on Hummels but title hopes remain|
|Watzke won´t give up on keeping Hummels|
|Pepe tips Zidane to become top coach|
|Allegri and Mancini laud Ranieri´s Leicester heroics|
|Allegri still hopes to keep Morata at Juventus|
|Mancini praises ´top-quality´ Banega|
|´Even Guardiola needed time´ - Brocchi has no regrets over taking AC Milan role|
|Willian desperate for next season to arrive|
|Mancini: Inter season not a disaster|
|Chelsea v Tottenham: Pochettino hopes derby motivation keeps title chase alive|
|Crotone not Italy´s Leicester, says director Ursino|
|Klopp: Flanagan still faces fitness battle|
|Manchester United v Leicester City: Ranieri aiming for Hollywood ending to title push|
|Hummels to Bayern is the logical deal - Hitzfeld|
|Shaw pushing for United comeback this season|
|Sportiello ´proud´ to be linked with Napoli|
|Arsenal must change to end title drought - Cazorla|
|Tete can´t confirm Bayern interest|
|Montero, Valencia set for Copa America Centenario|
|Vardy, Mahrez more important than Leicester´s defence - Martinez|
|Pellegrini blasts ´unbelievable´ Premier League fixtures|
|Standard Liege terminate Valdes´ loan deal|
|Hiddink: Leicester will not disappear|
|Mata: Leicester can wait a week|
|Pizarro, Farfan not included in Peru´s 40-man Copa squad|
|Wenger: My loyalty helped build Emirates|
|Pochettino eyes Ferguson legacy at Tottenham|
|Thompson to leave Melbourne Victory|
|New York Red Bulls 4 FC Dallas 0: Hosts make it two in a row|
|Blanc hails ´motivated and disciplined´ PSG|
|Van Gaal: Easier for Leicester to sign players than United|
|No shocks as Paraguay announce provisional Copa squad|
|Suarez headlines Uruguay´s Copa America squad|
|Sturridge reveals he is ´not Liverpool for life´ and hopes to match Suarez success|
|David Luiz, Silva and Marcelo absent from Brazil´s preliminary Copa America squad|
|Augsburg 0 Cologne 0: Weinzierl´s men edge closer to survival|