Esteban Obiang’s 70th-minute goal gave Equatorial Guinea the victory and brought Algeria’s 35-game unbeaten record crashing to an end.
The 2019 Cup of Nations winners could only draw 0-0 with Sierra Leone in their opening game in Cameroon and are now left needing to beat Ivory Coast in their final Group E outing on Thursday if they are to advance to the last 16.
The Ivorians, who were last continental champions in 2015, were held 2-2 by Sierra Leone earlier and the group remains wide open but with Algeria bottom on just one point.
Meanwhile an Equatorial Guinea side ranked 114th in the world and 28th in Africa are now well placed to reach the knockout stages for the third time.
The two previous occasions came when they were hosting the tournament, in 2012 and in 2015, but this time many of the fans in the crowd of almost 12,000 in Douala were supporting the ‘National Thunder’.
Equatoguinean capital Malabo, on the island of Bioko, is a short hop over the Gulf of Guinea from Cameroon’s economic capital.
Few of their fans could have foreseen this result against an Algerian side captained by Manchester City’s Riyad Mahrez and almost entirely the same as that which won the 2019 AFCON final against Senegal.
Yet Algeria struggled to break down the opposition defence, while both Baghdad Bounedjah in the first half and Youcef Belaili late on had goals disallowed for offside.
The outstanding Iban Edu Salvador came close from long range for Equatorial Guinea in the first half and also created a chance that Luis Nlavo could not finish shortly after the break.
They again came close on a breakaway midway through the second half but it was from the corner that followed that their goal arrived — the delivery from the left was flicked on to the back post where the Spanish-born Obiang tucked it in before running to celebrate with the crowd.