FORTALEZA, Brazil (AP) Didier Drogba played the full 90 minutes. Yaya and Kolo Toure stayed in Brazil despite a family tragedy, with the younger of the brothers a standout in the match. The Brazilian fans roared them on and booed their opponents.
Ivory Coast was moments away from its biggest World Cup success. But a penalty with nearly all the three minutes injury time used up cancelled the celebrations.
Former Celtic striker Georgios Samaras scored a penalty, as Greece sank the Ivory Coast 2-1 to jump from last place in Group C to reach the knockout stage for the first time.
Within minutes Ivory Coast coach Sabri Lamouchi had announced his decision to quit, and one of Africa's best hopes of succeeding in Brazil was planning the trip home.
''It's been great and I've been so proud to represent this great nation,'' Lamouchi said. ''The result was cruel but the Greeks did not steal the victory. At the highest level, details will cost you.''
The 42-year-old former France international took over the Elephants two years ago, and his squad started the match against Greece poised to make the knockout stage for the first time in three attempts.
But the Ivorians were held back by the defensive Greeks.
''My contract was ending at this World Cup and there will no renewal. The reasons why are obvious,'' Lamouchi said. ''My journey with the Ivory Coast ends here.''
Ivory Coast beat Japan in its opener, with Drogba sparking a second-half comeback after going on as a substitute. Despite a 2-1 loss to Colombia, the Ivorians only needed a draw Tuesday to advance.
Greece went ahead early via Andreas Samaris, but Gervinho set up the equalizer with 16 minutes left, running through the defense to slip a pass to substitute Wilfried Bony for the goal.
It wasn't enough to stop the upset. And the Ivorians reacted with disbelief when Ecuadorian referee Carlos Vera punished Giovanni Sio for stepping on Samaras in the area.
Yaya Toure, whose brother Ibrahim died of cancer in Britain last week, found it difficult to speak.
''What can you say when you see that penalty?'' he said, his voice barely audible.
''At one point we had a lot of hope ... What can I feel, what do you feel when you lose a match like that? Very disappointed.''