Zinedine Ferhat opened the scores midway into the second half before an own goal by Youssouf Traore in the closing stages secured victory for the Algerians, and condemning the Malians out of the competition.
Mali saw much of possession but it was the tactically discipline of the Algerians that paid off leading to well-worked out goals in the second period.
The West Africans had the first chance at goal on 14 minutes following a one-two between leading marksman Adama Niane and Yves Bissouma, but Niane’s effort missed target by inches.
Seven minutes past the hour mark, Niane who was a thorn in the flesh of the Algerian defence was felled by Riyad Keniche at the edge of the penalty area, but the resultant free-kick by TP Mazembe midfielder Adama Traore bounced off the human wall.
On 73 minutes, Ferhat broke the deadlock by finishing off a three-man move with Oussama Chita and substitute Oussama Darfalou as the other actors. Chita broke off from the middle, and fetched Darfalou, who crossed for Ferhat to tap in past hapless Mali goalie Djigui Diarra.
The Algerians were on the attack again seven minutes from time from a counter, and Zakaria Draoui laid a cross which ricocheted off Traore past Diarra for the second goal, taking the game beyond the Malians.
Mali will wrap up their campaign against Egypt on Saturday with pride at stake for them.