Mali advanced to the last 16 of the Africa Cup of Nations as Group E winners after beating Angola 1-0 in Ismailia.
Amadou Haidara scored the game’s only goal, finding the net with a fierce drive from outside the area.
Mohamed Magassouba’s side will face Group D runners-up Ivory Coast in the last 16 on Monday.
Angola, who finish third in Group E, miss out on a place in the knockout stages.
Mali made eight changes to the side that drew 1-1 with Tunisia on Friday and they rode their luck early on, Gelson shooting straight at goalkeeper Djigui Diarra before Mateus dragged another effort wide of the near post.
A draw would have been enough for Angola to advance, but they fell behind when Haidara fired an unstoppable shot past Tony Cabaca eight minutes before half-time.
Second-half substitute Moussa Marega missed the chance to double Mali’s lead late on, blazing over the crossbar from an acute angle.
Tunisia join Mali in the last 16 after drawing 0-0 with Mauritania in Suez.
By BBC World Service Sport’s Ben Sutherland
Angola’s Afcon campaign spluttered and died whereas Mali surprisingly top Group E with 3 wins from 3.
This was a game that had absolutely nothing to recommend it apart from the beautiful, crisply taken Haidara goal.
Having watched Benin grind out the 0-0 draw they needed before the game in the same stadium, Angola were set up with exactly the same plan – to get the draw.
But when Haidara netted eight minutes before the break their plan was in pieces – and they had nowhere else to go.
The result will be celebrated most in South Africa – Angola’s defeat means that Bafana Bafana go through as one of the four best third-place finishers.
Mali’s caretaker coach Mamadou Magassouba is making a strong case to stay on permanently.