Algeria defeated favourites Ivory Coast 4-3 on penalties on Thursday to progress to the semi-finals of the Africa Cup of Nations.
The match in Suez, Egypt went to extra time after regular time ended in a 1-1 draw, during which the North Africans conceded their first goal of the tournament.
Galatasaray Istanbul's Sophiane Feghouli put Algeria in the lead in the 29th minute but Baghdad Bounedjah later squandered an opportunity to make it 2-0 by missing a penalty.
In the second-half, Ivory Coast's Jonathan Kodja pushed the game into extra time with a shot into the left-hand corner.
Keeper Rais M'Bolhi made a decisive save for the Algerians during the penalty shoot-out by stopping Wilfried Bony's effort, while Serey Die's shot was deflected by the post.
Algeria, who last won the Cup in 1990, will now face Nigeria in the semi-finals.
Tunisia meanwhile ended Madagascar's fairytale run 3-0, and is set to play Senegal in the first of Sunday's semi-finals.
The Madagascans, who have no professional league, had been competing in the Cup for the first time and had caused a sensation by progressing to the knock-out stages by beating better-ranked teams including Nigeria.
At Cairo's al-Salam Stadium on Thursday however they could not match the professionalism of the Tunisians, who won comfortably with goals from Ferjani Sassi, captain Youssef Msakni and Wahbi Khazri.