Ghana captain Asamoah Gyan struck a dramatic late winner to keep alive his side’s hopes of reaching the Africa Cup of Nations quarter-finals.
In a game of very few chances, Gyan snatched an unlikely victory when he latched on to a long ball and angled in a drive in stoppage time.
Algeria missed the only other clear chance when Nabil Bentaleb side-footed well wide from 12 yards on 20 minutes.
The game had looked set to remain goalless until Gyan’s late strike.
Gyan missed Ghana’s opening match loss to Senegal because of a bout of malaria and although he was understandably lacking sharpness on his return, he persevered until the very end to rescue his team.
The striker has now scored in each of his last six games for the Black Stars, who did not make life easy for their talisman as they toiled to create chances in a scrappy game.
Ghana failed to muster a single effort at goal in the opening period as the Algerian defence, well marshalled by returning captain Madjid Bougherra, easily coped with a succession of hopeful punts forward.
Yet Algeria fared little better, managing only two efforts, both of which were wayward. While Faouzi Ghoulam’s early attempt was purely speculative for Algeria, Bentaleb’s side-footed shot from inside the box was a waste of an excellent opportunity forged by clever interplay between Yacine Brahimi and Aissa Mandi.
In an overly physical first half, there might have been more red cards than shots, but somehow Bentaleb, Ishak Belfoldil and Emmanuel Badu all escaped without punishment after the three were involved in an ugly bout of shoving.
Quality continued to be in short supply after the break, but at least Ghana began to show some attacking intent.
However, Gyan could not direct a difficult diving header on target and dragged another shot well wide and Ghana striker Jordan Ayew flicked over an improvised volley at the near post.
At the other end Bentaleb fizzed a low shot wide of the right post after being played in by Brahimi.
It proved to be a costly miss for Algeria as Gyan ran on to a long ball over the top by substitute Mubarak Wakaso and sent a scruffy shot into the bottom left corner.
Ghana coach Avram Grant: “Asamoah Gyan was not fit – he didn’t train like he needed to – but he’s Asamoah Gyan, if you look at the stats and his behaviour in the dressing room.
“You know I have been coach of some of the great players – he’s one of the greatest. First – he always scores when you need him. Second – he’s good for the spirit of the team – he’s a very good captain.”