Amadou Haidara's stunning goal sent Mali into the Africa Cup of Nations last 16 as Group E winners with a 1-0 win over Angola, who were consequently eliminated.
RB Leipzig midfielder Haidara fired a fine 20-yard strike past Tony Cabaca in the first half and it proved to be sufficient to set up a meeting with Ivory Coast in the knockout stages.
Angola were unable to find an equaliser that would have sent them through as one of the best third-placed teams, with South Africa progressing instead.
Srdjan Vasiljevic's side had a chance to take the lead in the fourth minute when Mateus fed Gelson Dala in the box, but the striker's tame shot was held by comfortably by Mali goalkeeper Djigui Diarra.
Falaye Sacko saw his 20-yard strike kept out of the bottom-left corner by Cabaca before Kalifa Coulibaly nodded wide after the half-hour mark.
The breakthrough finally came for Mali in the 37th minute when Haidara arrowed a shot home with Cabaca rooted to the spot.
Angola sent on Show and Wilson Eduardo in the 52nd minute but the former was unable to hit the target with any of the three chances that came his way.
Gelson was similarly profligate and Cabaca had to scamper down to his bottom-right corner to deny Adama Traore in the 78th minute as Mali saw out the win in routine fashion.