Equatorial Guinea shocked Algeria, leaving the defending champions at the risk of crashing out of the Africa Cup of Nations in Cameroon in the group phase.
With 20 minutes remaining in Douala, Esteban Obiang snuck in at the far post to convert a flick-on and score the game's only goal.
Algeria have only one point from their first two games and will need to overcome Ivory Coast in their last Group E match to have a chance of qualifying for the last 16.
The North Africans had two goals disallowed in a gritty match.
Algeria's 35-match unbeaten run came to an end with this setback, two short of Italy's world record set last year. It was Algeria's first defeat since October 2018.
Equatorial Guinea reached the Nations Cup semi-finals as hosts in 2015, but this year, after qualifying for the tournament by right for the first time, it will be remembered as one of their most significant achievements.
Juan Micha's team now have three points and is in second place in Group E, with Ivory Coast on top with four, Sierra Leone in third with two, and Algeria in last place with one.
The group's tightness will make Thursday's final round of games exciting, with the Equatoguineans taking on the Leone Stars in Limbe and Algeria taking on the Ivory Coast in Douala (16:00 GMT).
Man of the match: Ivan Salvador
Spectacular performance all around 👏— #TotalEnergiesAFCON2021 🏆 (@CAF_Online) January 16, 2022
The TotalEnergies Man of the Match is #TeamEquatorialGuinea’s Iván Salvador 💪#TotalEnergiesAFCON2021 | #AFCON2021 | #ALGGNQ | @Football2Gether pic.twitter.com/HWY5qog19q
Algeria 0-1 Equatorial Guinea: Watch the match highlights
📹 𝐇𝐈𝐆𝐇𝐋𝐈𝐆𝐇𝐓𝐒: 🇩🇿 0-1 🇬🇶— #TotalEnergiesAFCON2021 🏆 (@CAF_Online) January 17, 2022
A miraculous result for #TeamEquatorialGuinea who upset all the possible odds against title holders Algeria.
#TotalEnergiesAFCON2021 | #AFCON2021 | #ALGGNQ | @Football2gether pic.twitter.com/VtQjbqxn04