Mali threw away their chance to reach the quarter-finals of the Africa Cup of Nations after they were comprehensively beaten by Group B winners Ivory Coast.
Didier Drogba scored on his 50th appearance for Ivory Coast
The defeat meant Nigeria edged into the last eight despite being third in the group before Tuesday's crucial games.
Didier Drogba opened the scoring with a smart finish on 10 minutes when he shot across goal from a Yaya Toure pass.
The Elephants made it 2-0 from a corner when Marc Zoro nodded in and sealed it with a Boubacar Sanogo rebound.
Ivory Coasts' reward for a perfect record in Group B is a quarter-final tie with Guinea in Sekondi on Sunday, meaning they avoid hosts Ghana.
The Ivorians came into the match already having qualified with Mali needing only a draw to guarantee their progression to the last eight at the expense of Nigeria, who played benin in their final game.
After a cagey start the match was enlightened by a goal of real quality from Drogba who was making his 50th appearance for the Ivorians.
Toure collected the ball about 35 yards from goal as Drogba pulled away from his defender on the left side of the penalty area. Toure then slipped the Chelsea striker a perfect ball before he fired his right-footed shot across goal.
Ivory Coast should have extended their lead from a corner after 18 minutes when Zoro, who replaced the injured Kolo Toure in the starting line-up, put a free header wide from less than six yards.
And Arouna Kone failed to hit the target with another header after a fine run and cross from full-back Siaka Tiene down the left.
Although Mali were failing to make any significant inroads, they did go close with a Dramane Troure header after a mix-up in the Ivorian defence following a right-sided free-kick.
But in truth the Elephants looked very comfortable and continued to dictate proceedings as the first half came to close. Mali's front line was starved of any service and when star striker Fredi Kanoute did get the ball, he was quickly surrounded by the Ivorian defence.
Despite a disappointing first period, it was still a surprise that Kanoute was replaced by midfielder Momo Sissoko at half-time, particularly as a goal from Nigeria - who were goalless with Benin at half-time - could send Mali out.
That said, the change seemed to give Mali an added impetus and Seydou Keita drew a good save from Boubacar Barry with a curling left-footed free-kick from 25 yards.
But with news filtering through that Nigeria had taken a 1-0 lead in Sekondi, Mali suffered a double blow as Ivory Coast extended their lead after 54 minutes.
It was a simple finish from the powerful Zoro, who leapt at the near post from a Tiene corner to nod home.
Twice Drogba nearly made it 3-0, first with a header cleared off the line and then after drawing a good save from Sidibe at the end of a flowing move.
Set-pieces continued to offer the best openings for both teams and Mali's Dramane Traore looked like he might provide a lifeline when he headed against the bar from a lofted Keita cross with Ivorian keeper Boubacar Barry nowhere to be seen.
Sissoko's influence was negating that of Yaya Toure in midfield but there was little cutting edge for the Malians, making the situation more desperate with only one goal needed to qualify as things stood half-way through the second period.
If anything Ivory Coast looked more likely to score when Kone broke forward and Mali's negative approach became more puzzling in the closing stages.
The Eagles needed a different tact but with the game petering out substitute Sanogo tucked in the rebound from a long-range shot to seal it for Ivory Coast and leave Mali ruing a missed opportunity with qualification in their hands at the start of the match.
Ivory Coast: Barry, Eboue, Zokora, Fae, Zoro, Romaric, Tiene, Toure Yaya, Keita (Bakari Kone 59), Arouna Kone, Drogba (Sanogo 75).
Subs Not Used: Tiassa Kone, Loboue, Gohouri, Boka, Meite, Toure, Dindane, Gervinho, Kalou, Djakpa.
Goals: Drogba 10, Zoro 54, Sanogo 86
Mali: Mahamadou Sidibe, Adama Coulibaly (Diallo 47), Kante, Tamboura, Sammy Traore, Drissa Diakite, Keita, Djibril Sidibe, Toure (Dissa 60), Kanoute (Mohamed Sissoko 46), Dramane Traore.
Subs Not Used: Soumalia Diakite, Oumar Sissoko, Moussa Coulibaly, Dembele, Amadou Sidibe, Kone, Diamoutene, Mamady Sidibe.
Ref: Eddy Maillet (Seychelles).