PORT ELIZABETH, South Africa -- Cape Verde scored in injury time for a come-from-behind 2-1 win over Angola to reach the African Cup of Nations quarterfinals on Sunday, dramatically prolonging its first appearance at a major tournament.
Heldon Ramos powered in a shot from a loose ball after the clock moved past 90 minutes for a late win that left tournament newcomer Cape Verde to squeeze through to the last eight with host South Africa, which drew 2-2 with Morocco in Group A's other game.
Morocco had looked set to go through with its draw in Durban, but was eliminated at the very end of the group games because of Ramos' goal. South Africa qualified top of the group and the Cape Verdeans second.
In Port Elizabeth, Cape Verde captain Fernando Neves' own goal in the 33rd had his team trailing and on the verge of being eliminated.
But Fernando Varela headed in after a goalmouth scramble in the 82nd to level, and Ramos' late winner saw Cape Verde's entire squad and coaching staff run onto the pitch to celebrate as Ramos was buried under a pile of players and officials near the corner flag.
"Today we came here to win the game. There was no chance we could even consider a failure," Cape Verde coach Lucio Antunes said.
Ramos powered his shot into the roof of the net after Angola goalkeeper Lama parried a cross into his path to set off the chaotic celebrations, which were led by Antunes sprinting up the touchline.
The coach had consistently insisted through the tournament that his team from the tiny island nation was good enough to be taken seriously at Africa's top tournament.
Cape Verde's entire team then burst into the post-match news conference to chant and sing and dance in front of reporters, with Antunes in the middle with the blue flag of his country draped across his shoulders.
"We came here with the determination to win this game and from the first minute we worked," said Antunes, who also sang what he described as a traditional Cape Verde song to reporters.
"It was the dedication of the players," the coach said.
Angola scored its first goal of the tournament when Amaro whipped a low cross into a dangerous area. Tangling with Mateus da Costa, Neves got the last touch as the ball slipped into the bottom corner.
Angola's Uruguayan coach Gustavo Ferrin celebrated vigorously, punching his arms out in front of him and yelling in delight. But his team eventually succumbed as a desperate Cape Verde ramped up the pressure at the end.
"It was just the last 15 minutes when we lost the match," Ferrin said. "My players gave their all. One-one was a result that didn't interest us and so we had to go for the kill. By opening up those spaces, we suffered."
Cape Verde had better chances in the first half but the Angolans weren't far behind.
Ryan Mendes' eighth-minute shot dipped just too late as Cape Verde started well, while Manucho flashed an angled header past the right post in the 12th minute for Angola.
Cape Verde was denied an equalizer in the second minute of the second half when Angola cleared off the goal line from a corner after a scramble in the box.
Manucho rocked a shot off the right post from a tight angle but was offside, and Cape Verde then finally began to take control.
Ramos had a free kick scrambled away by Lama in the 66th as the Angolans continued to live dangerously, keeping the few South African fans at Nelson Mandela Bay shifting nervously in their seats with their team's hopes also on the line.
Marco Soares hit a drive narrowly over the crossbar in the 68th as Antunes watched on with a grimace and Djaniny Semedo came even closer for the islanders in the 72nd as the rain began to lash down.
Varela's header from close range finally gave the minnow a glimmer of hope before Ramos' late intervention saw them erupt with joy.
"We've got beautiful players, talented players," captain Neves said. "Now we're trying to go as far as possible."