Georgios Samaras converted a controversial injury-time penalty to seal the win after he was adjudged to have been fouled by Giovanni Sio.
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 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.
- Chamisa under fire over US$120K donation
- Mavhunga puts DeMbare into Chibuku quarterfinals
- Pension funds bet on Cabora Bassa oilfields
- Councils defy govt fire tender directive
Keep Reading
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.