Brazil (BBN)-Greece qualified for the last 16 of a World Cup for the first time with a dramatic victory against Ivory Coast.
Celtic's Georgios Samaras converted a controversial injury-time penalty to seal the win after he was adjudged to have been fouled by Giovanni Sio, reports BBC.
Greece had taken a first-half lead when substitute Andreas Samaris scored after Cheick Tiote's defensive mistake.
Ivory Coast had looked like advancing as Wilfried Bony equalised from Gervinho's pass, before the late twist.
Soon after their elimination from the tournament was confirmed, Ivory Coast coach Sabri Lamouchi resigned.
Greece will face Costa Rica in the second round in Recife on Sunday, while the Ivorians have now gone out in the group phase in each of the last three World Cups.
They began the day second in the table and, with Colombia beating Japan 4-1 in the other Group C match, needed only a point to become the first African side to qualify for the second phase in this year's competition.
However, Greece, who offered little as an attacking threat in the second half, were given an opportunity to grab the winner when referee Christian Lescano pointed to the spot, despite strong Ivorian protests.
They were unhappy that Samaras, who kicked the turf, had fallen to the ground, but the official gave the decision and Samaras kept his composure to shoot past Ivory Coast goalkeeper Boubacar Barry for his first international goal since Euro 2012.
Greece started the day bottom of their group, and their hopes of qualifying suffered a further setback when they had to make two substitutions inside the first 24 minutes, including goalkeeper Orestis Karnezis with a back injury.
However, they created the best first-half opportunities with Samaras leading a quick attack and releasing Jose Holebas, whose shot from the edge of the penalty area rebounded off the crossbar.
Fernando Santos's Greece team went ahead with their first goal of the tournament and only their third in three World Cups.
Newcastle midfielder Tiote carelessly lost the ball to Samaris, who played a one-two with Samaras before lifting the ball over Ivory Coast goalkeeper Barry.
Despite the African side seeing more of the possession after the break, Karagounis almost made it 2-0 with a long-range effort that hit the crossbar.
But Ivory Coast, who had seen Salomon Kalou and Wilfried Bony shoot wastefully wide earlier in the second half, deservedly equalised with a quick counter-attack as ex-Arsenal forward Gervinho set up Bony.
The Swansea striker, who scored in their 2-1 win against Japan on Sunday, calmly finished past substitute goalkeeper Panagiotis Glykos.
That goal sparked wild Ivory Coast celebrations, but their joy turned to despair with Samaras's 93rd-minute penalty.
Ivory Coast coach Sabri Lamouchi: "My contract comes to an end at this World Cup and there will be no epilogue. It is logical as we did not do well at last year's Africa Cup of Nations or at the World Cup finals.
"The Ivory Coast is a great football nation. And this was a cruel game. After so much hard work and so much sacrifice, all of us and everyone in the Ivory Coast is very sad."
Greece coach Fernando Santos: "We found balance tonight. We are not the worst team when we lose or the best when we win.
"To everyone in Greece I say, 'Go out into the street and celebrate.'"
Greece captain Giorgos Karagounis: "We came here to advance from the group stage. We've never done it before, and we did in a great way.
"The goal should have come earlier. So God helped us in the end and we all thank him. We prevailed against the odds. We had passion and we had fight."