Cabinda - Algeria clawed back from the brink of elimination to stun title favourites Ivory Coast 3-2 on Sunday and reach the Africa Cup of Nations semi-finals.
Victory for Algeria sets up the prospect of a last-four showdown with bitter rivals Egypt, who they deprived of a place at the 2010 World Cup in South Africa after a play-off.
Defending champons Egypt face four-time winners Cameroon on Monday in a clash of giants, but the teams will struggle to match the drama of this encounter.
Ivory Coast entered the second quarter-final with a far superior record than Algeria at this stage of the biennial African football showcase, having won four of five ties while their rivals lost all three.
There was one enforced change in the Ivorian 'Elephants' line-up with Guy Demel from German Bundesliga outfit Hamburg replacing suspended Emmanuel Eboue in the back four.
Algeria introduced fit-again defender Antar Yahia in place of ill Abdelkader Laifaoui for his first appearance of the tournament and midfielder Mourad Meghni took the place of Bouazza.
Tradition favoured the 'Elephants' with two wins and a draw from four previous clashes with the 'Desert Foxes' in a match between countries with one Nations Cup title each to their credit.
As the match kicked off amid steamy evening conditions in this oil-rich northern Angola enclave the chief concern of Ivory Coast coach Vahid Halilhodzic was rustiness with their last match nine days ago.
Algeria had a point to prove after accusations they and Angola had 'fixed' a goalless Group A draw in Luanda to ensure both qualified at the expense of Mali.
But if the Ivorians were rusty it did not show on four minutes as they reacted quickest in a goalmouth scramble and Kalou struck the ball past goalkeeper Faouzi Chaouchi to give the west Africans a perfect start.
Early attacking traffic was heading largely toward the goal of the white-kit Algerians and Rafik Halliche was lucky to escape unpunished when he fouled Didier Drogba inside the area and Ivory Coast should have been awarded a penalty.
Algeria were gradually showing more confidence and coming at their opponents and after coming close a few times, the north Africans deservedly equalised as half-time approached.
A lofted pass toward the Ivorian penalty area missed friend and foe and fell invitingly for Matmour from Borussia Moenchengladbach, who left Boubacar Barry helpless with a shot that flew in off a post.
A fascinating see-saw struggle continued to offer scoring chances at each end with Drogba narrowly failing to reach a Kalou crossed and Barry foiling Matmour when he broke through and had only the goalkeeper to beat.
But the miss of the second half came five minutes from full-time when Kouassi 'Gervinho' Yao burst clear when Bougherra failed to intercept a pass only to blaze over with just Chaouchi to beat.
In a sensational climax to regulation time Keita scored six minutes after replacing Kalou with a candidate for goal of the tournament, unleashing an unstoppable shot from outside the area into the roof of the net.
Algeria refused to surrender, however, and unmarked defender Madjid Bougherra was first to a cross on 92 minutes and headed the ball down and up over Barry to take a thriller into extra time.