Debutants Cape Verde qualified for the last eight of the Africa Cup of Nations after coming from behind to beat Angola 2-1 in Port Elizabeth.
The Angolans took the lead on 33 minutes through an own goal from Cape Verde defender Neves.
The Blue Sharks equalised with nine minutes left, as defender Fernando Varela headed in from close range.
Substitute Heldon snatched the winner in the 90th minute to secure second place in Group A behind South Africa.
Lucio Antunes' side are the smallest nation ever to compete at the Nations Cup and their progression defies many pre-tournament predictions, as they join the hosts in the quarter-finals, after the South Africans' 2-2 draw with Morocco .
Cape Verde boss
Blue Sharks coach Lucio Antunes is on leave from his job as an air-traffic controller and shadowed Real Madrid boss Jose Mourinho in the build-up the tournament
The Angolans had started much brighter than in their previous two group games, knowing they needed a win to progress, while Cape Verde continued the smart attacking play they had displayed against South Africa and Morocco.
The ever-lively Cape Verde striker Platini was busy from the offset and their other creative spark Ryan Mendes tried to curl an early attempt into the top corner, only to watch it sail just over.
Angolan target man Manucho became the Palancas Negras' main threat from the outset, getting on the end of an excellent in-swinging free-kick from Gilberto, only to head just wide.
Cape Verde increased the pressure and won a corner for their efforts with Mendes' in-swinger glancing off striker Tavares' head and over Angolan keeper Lama's bar.
Platini proved a handful for the Angolan defence, as he refused to allow them any time on the ball, but was unable to create an opening, having stolen the ball from them a couple of times in quick succession.
Amaro was busy down the left Angolan flank and his perseverance paid off as he was fed by Campos, before crossing a dangerous ball, which flicked in off Neves, under pressure from midfielder Mateus to hand the Angolans the opener.
Tavares very nearly levelled it up immediately at the other end but it skimmed just wide off his head.
Cape Verdean midfielder Babanco then whipped in a smart shot after a good run, which Angolan keeper Lama palmed away at the near post.
Antunes then made a couple of shrewd attacking changes at the interval, with Platini making way for Heldon and Djaniny coming on for Toni Varela, as he reacted to his side going behind for the first time in the tournament.
Angolans bow out
Angola exit the tournament at the group stage for the second year in a row, having reached the quarter-finals on home soil in 2010
They almost got themselves back in the tie immediately after the break, with Tavares' close-range effort cleared off the line by Angolan midfielder Dias.
Manucho then almost doubled Angola's lead, as he collected the ball in the box, turned well and fired low across Vozinha's goal, only to see his effort cannon off the foot of the post.
At the other end, Tavares almost capitalised on confusion in the Angolan defence, as he was almost allowed to slip in before Lama gathered to avert the danger.
Heldon then whipped in a dangerous free-kick from 30 yards, which Lama spilled before the Angolan defence cleared.
Fellow substitute Djaniny then collected a clever flick from Mendes on six yards but was unable to finish, as it was cut out by Angolan defender Marco Airosa.
Cape Verde finally hauled themselves back into contention with nine minutes left on the clock, as Varela headed in from close range, after Lama's fumbled attempt at a punch from a cross.
Heldon then sensationally grabbed the winner in the final minute of normal time, meeting Marco Soares' ball sweetly and burying it past Lama to spark wild celebrations on the Cape Verde bench.
Cape Verde coach Luis Antunes:
"My team and I dedicate this victory to the wonderful people of the Cape Verde Islands.
"Our objective at this tournament has been achieved.
"We wanted to reach the quarter-finals."
Angola coach Gustavo Ferrin:
"We had no option but to attack in search of a winner and left ourselves open at the back."
Sorry, we were unable to load match stats, please try again.