Algeria stunned African Cup of Nations favourites Ivory Coast 3-2 in extra-time to book their place in the semi-finals.
Bouazza the hero off the substitutes' bench
Algeria stunned African Cup of Nations favourites Ivory Coast 3-2 in extra-time to book their place in the competition's semi-finals.
The Ivory Coast had been expected to challenge strongly in Angola but their bid for glory came to an end in Cabinda courtesy of Algeria substitute Hameur Bouazza.
It was the most impressive of displays from Rabah Saadane's team as they twice had to come from behind to force extra-time, before Bouazza scored the decisive goal.
Salomon Kalou's strike had put the Ivorians in charge, only for Karim Matmour to score an equaliser just before half-time. When Kader Keita restored Ivory Coast's advantage a minute from time there looked to be no way back for Algeria, but Madjid Bougherra had other ideas as his header forced an extra half-an-hour.
Blackpool forward Bouazza netted a dramatic winner two minutes after coming on to hand his side a well-deserved win against Vahid Halilhodzic's below par Elephants.
It was a dramatic turnaround after the Algerians looked nervous through the opening exchanges and fell behind four minutes in.
Early blow
Yaya Toure's shot was deflected into the path of Kalou on the right side of the penalty area and the Chelsea striker executed a low finish beyond Faouzi Chaouchi at the near post.
It continued to look easy for the Elephants as Didier Drogba had a penalty appeal turned down - the referee deemed Rafik Halliche's sliding challenge a fair one.
The Algerians eventually began to settle as the game reached the 20-minute mark and Boubacar Barry almost gifted them a goal when his attempt to make a routine clearance was charged down by Abdelkader Ghezzal only for the ball to rebound wide.
More Algeria pressure followed as the momentum looked to have totally shifted and, apart from occasional tussles between Drogba and Bougherra, the Algerians took charge.
The pressure eventually told five minutes before half-time when a long ball from Antar Yahia bounced loosely on the edge of the Ivorian penalty area, with Matmour forcing his way in between two defenders and finishing emphatically with a strike that took the upright before going in.
That brought up half-time and after a quiet restart, the pace dramatically picked up as the game approached the hour mark.
First Matmour missed a glorious chance to put the Desert Hawks in front when he blazed over from just inside the box after receiving a delightful pass over the top from Mourad Meghni.
There was a crucial moment in the 68th minute when Souleymane Bamba was dispossessed by Matmour on the edge of the penalty area, but the Borussia Monchengladbach midfielder saw his shot excellently kept out by Barry.
Saadane's men continued to pile on the pressure, but their west African opponents were still a threat on the break as Yaya Toure illustrated with another shot that forced a full length dive from Chaouchi, but drifted narrowly wide.
Five minutes from the end and having just come on, substitute Kader Keita led another sweeping counter attack with a pin-point pass to Gervinho, but the Lille forward blasted his effort over.
The Galatasaray midfielder then smashed in a 25-yard screamer that went in off the upright and looked to have won the game with just a minute to play.
Enter stoppage time and the Algerians refused to give in. A sweeping cross from the left, along with sloppy defending from the Ivorian defence, allowed Bougherra in and the Rangers defender headed home powerfully.
Late drama
The Elephants looked shell-shocked and their opponents took full advantage less than two minutes into extra-time.
Bouazza, introduced after the 90 minutes ended, was left unmarked at the far post and leapt high to nod in Ziani's cross from the left to put Algeria ahead for the first time.
Their opponents tried to respond with Drogba's fierce 18-yard shot somehow blocked by Chaouchi, who helped his side stay 3-2 ahead after 105 minutes.
Straight from the restart there were chances aplenty for the Algerians to kill off the game as Ivory Coast went for broke - Ghezzal mis-hitting the best of the chances in the form of a virtual tap-in that seemed almost impossible to miss.
At the other end, Bamba put a goal-mouth scramble for his side wide, while the final attempt, which came to Kolo Toure and was expertly finished, was judged offside as the tournament favourites bowed out.