Cape Verde Islands finished on five points to advance along with hosts South Africa, who drew 2-2 with Morocco in Durban, and topped the table thanks to a better goal difference.
The west African islanders overcame mighty Cameroon to debut at the finals of Africa's showpiece football event, where they again impressed with draws against hosts South Africa and Morocco before coming from behind to beat the Angolans for what was their first ever Africa Cup of Nations victory.
Angola were rewarded for their offensive play after 33 minutes when Amaro delivered a cross and Mateus put Neves under pressure with the ball coming off the Cape Verde Islands skipper and into his own net. Cape Verde Islands restored parity in the 81st minute when Gege headed home after sustained pressure on Angola and Heldon clinched the game in the last minute as he fired home a rebound after Lama could not hold a fierce shot.
Angola apply the pressure
The Black Antelopes of Angola took the game to Cape Verde Islands from the first blast of the whistle, using the wings and long balls. It was scrappy opening, but Angola were first to settle and continued to attack. But after eight minutes the outstanding Ryan Mendes' chipped shot from outside the box came close to giving Cape Verde Islands the lead against the run of play.
Minutes later, Angola skipper Manucho almost profited from a mix-up between goalkeeper Vozinha and skipper Neves, but the Tunisian referee signalled a foul against the big Real Valladolid striker. In the 12th minute, Manucho again threatened with a header from a free kick as Mateus on the right flank and Djalma on the left became a constant danger to their opponents.
A minute after the resumption, another Tavares' header was kept out on the goal-line by an Angolan defender as Cape Verde Islands continued to mount pressure. Manucho was unlucky to see his low drive from inside the Cape Verde Islands goal area beat the goalkeeper but come off the foot of the post after 52 minutes.
Cape Verde Islands continued to press forward and Heldon's free kick was not held by the diving Lama in the 65th minute. Angola substitute Yano fired from an angle at goal late on, but it screamed wide of the target before Heldon delivered the winning effort in the final minute.