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.
Aussies Abroad: Vukovic’s Genk beaten in battle of Belgium’s top two
Danny Vukovic’s Genk remain well clear on top of the table despite falling to a rare defeat in Belgium against Club Brugge overnight. In a meeting of the competition’s top two at the Jan Breydel Stadion, Genk were beaten the fired-up home side, going down 3-1. There was lit
Aussies Abroad: Ryan’s Brighton through to Quarter-Finals while Milligan, Giannou pick up strong results
There were a handful of Caltex Socceroos in action on Sunday morning (AEDT) while some key figures were rested as their clubs negotiated cup ties. Firstly to Europe where Mark Milligan played a full 90 at the heart of Hibernian’s midfield as they welcomed new manager Danny Hec
Aussies Abroad: Luongo gallant in Watford defeat
Caltex Socceroos midfielder Massimo Luongo can turn his attention to the EFLChampionship after QPR crashed out of the FA Cup on Saturday morning (AEDT). The 26-year-old played the full 90 minutes in QPR’s 1-0 loss to Watford at Loftus Road, in a tight game where each side cou
When to watch your Caltex Socceroos this weekend
There's FA Cup action on the cards for two Australians this weekend as another prepares for a massive top-of-the-table encounter. Multiple players are involved in matches with major title ramifications, while Mark Milligan has a new manager to impress in Scotland. Read on t