Winger Nicolas Pepe scored a superb solo goal as Ivory Coast thumped Algeria 3-1 to send the defending champions crashing out of the Africa Cup of Nations finals on Thursday following a disastrous Group E campaign.
Algeria's 35-game unbeaten run was ended by Equatorial Guinea in a stunning upset in their last match, and they were outplayed again by the impressive Ivorians, who might have had more goals with better finishing.
Franck Kessie and Ibrahim Sangare also scored to seal top spot in the pool with seven points. They are joined in the second round by Equatorial Guinea (six points), whose 1-0 victory over Sierra Leone eliminated the latter.
When they won their only other Cup of Nations title in 1990, Algeria also exited in the first round of the next tournament after a 3-0 loss to the Ivorians, who went on to lift the trophy.
The game was a slow burner at the start with Algeria's Ramy Bensebaini striking the outside of the post in the only clear-cut chance in the opening quarter.
But the Ivorians hit the front on 23 minutes as Pepe was played into space on the right-hand side of the box and his cut-back was perfect for Kessie to side-foot home under pressure from six yards.
The lead was doubled on 39 minutes with a simple goal in its execution that will have left Algeria coach Djamel Belmadi fuming. Serge Aurier's deep free kick was met by an unmarked Sangare, who was able to power his header into the net unopposed.
The Ivorians were swift on the counter-attack and committed numbers forward, meaning they often had an overload on the Algerian defence, and in one such instance Pepe scored his goal.
He ran at the defence of the north African side and after shifting the ball onto his left foot, unleashed a thunderous shot past helpless Rais Mbolhi in the Algerian goal.
Algeria were awarded a penalty for a foul by Simon Deli, but while Mahrez sent the goalkeeper the wrong way, his shot struck the post and flew away to safety.
Bendebka scored from close-range on 73 minutes for a consolation.