Holders Algeria crashed out of the Africa Cup of Nations on Thursday after losing 3-1 to Ivory Coast in Douala.
The Dessert Foxes needed a win to stay alive, but found themselves trailing by two goals at the break after Franke Kessie capped off a fine move and Ibrahim Sangare headed home.
Nicolas Pepe had put the Ivorians 3-0 up before Algeria captain Riyad Mahrez hit a penalty against the post.
Sofiane Bendebka scored a late consolation for the North Africans who finished bottom of Group E.
Djamel Belmadi’s men are the third holders to exit at the first hurdle in the past five Nations Cup finals.
In the other fixture of Group E, Sierra Leone AFCON journey came to a disappointing end after a 0-1 defeat to Equatorial Guinea.
Midfielder Pablo Ganet curled in from the edge of the area to net the only goal seven minutes before the break.
Sierra Leone had needed a point to progress, but veteran striker Kei Kamara saw a 84th-minute penalty saved by Jesus Owono.
Equatorial Guinea finish second in Group E behind Ivory Coast.