It is the fifth time in the last six Cups of Nations that the reigning champions have failed to make the AFCON knockout phase, but there has arguably never been a worse title defence.
"A failure, simple as that," was how Algeria coach Djamel Belmadi summed it up.
"We never managed to take our chances, right from the start of the competition. Even penalties we had difficulty with. We just weren't good enough."
Algeria came to the tournament on an unbeaten run stretching back over three years but they were held by Sierra Leone in their opening match and then lost to Equatorial Guinea to suffer a first defeat in 36 matches.
They would have gone through with a win against an Ivory Coast side already guaranteed their place in the knockout rounds, but that never looked likely.
Their demise was lapped up by the fans at the Japoma Stadium in Cameroon's economic capital, with the 50,000-capacity ground filling up as the game went on.
By the time the match was over it looked like fans had taken up more seats than the 60 percent capacity limit imposed as part of coronavirus restrictions, and many invaded the pitch in chaotic scenes of celebration.
The Ivory Coast clearly had the backing of the crowd and they will stay in Douala for a heavyweight last-16 tie against Mohamed Salah's Egypt.
"I am very, very satisfied about what my team has done tonight," said the Ivory Coast's French coach, Patrice Beaumelle, who has twice won the AFCON as an assistant coach and had some sympathy for Algeria and their failed attempt to retain the title.
"It is always difficult because it is a coveted trophy and when we won it with Zambia in 2012 that inspired a lot of teams as well."
Equatorial Guinea go through in second place in Group E after defeating Sierra Leone 1-0 in Limbe thanks to a superb first-half strike from Pablo Ganet.
Kei Kamara missed a penalty for Sierra Leone as they go out while Equatorial Guinea will stay in Limbe for a last-16 tie against whoever wins Group F between Gambia, Tunisia and Mali.
The Group E results also ensured that debutants the Comoros go through and play hosts Cameroon next.
The Ivorians conceded a stoppage-time equaliser in their last game to draw 2-2 with Sierra Leone following a comical mistake by goalkeeper Badra Ali Sangare.
He then learned of the death of his father later that night, but he kept his place in the Elephants line-up.
They went ahead midway through the first half at the end of a great move as Pepe cut the ball back for Kessie to finish.
It was 2-0 six minutes before the interval as the unmarked Sangare headed in Serge Aurier's free-kick.
Algeria did not come out fighting after the restart and they might have fallen further behind before Pepe finished superbly in the 54th minute to make it 3-0.
Mahrez then hit the upright on the hour mark from a spot-kick awarded for a soft foul on Youcef Belaili.
They did get a first goal in over four hours of football when Aissa Mandi turned the ball back across goal for substitute Bendebka to score in the 73rd minute, but were spared extra misery when Sebastien Haller's late header was disallowed for offside.