After holding Mali to a 0-0 draw in their final group match on Wednesday, Namibia advanced to the Africa Cup of Nations knockout stage for the first time.
Namibia finished their Group E campaign with four points, which qualifying them as one of the top four third-place finishers.
After defeating Namibia 4-0 on Sunday, South Africa finished second in the group with four points, behind only Mali, who had won five.
After Tunisia and South Africa drew 0-0 in the other Group E match, Tunisia was eliminated.
Group winners Mali will play their rivals Angola on Saturday, while Namibia will play Burkina Faso in the round of 16 in Korhogo next Tuesday.
In their first-ever victory at the tournament, Namibia defeated Tunisia in their opening group match. On Wednesday, they advanced further in the competition by qualifying.
They faced the potent Mali team in their second group match and showed no signs of weariness following a 4-0 thrashing by rivals South Africa.
After 16 minutes, Namibia had its first chance when the small Prins Tjiueza broke through the defence but struck the upright with his shot. Captain Peter Shalulile then had a chance from point blank range, but Djigui Diarra of Mali stopped the rebound.
Fousseni Diabate attempted to score for Mali with a strong left-footed shot that was parried five minutes later.
An even better chance came in the 28th minute when Youssoufou Niakite’s enticing cross found Lassine Sinayoko unmarked and the Namibian defence out of place, but he misdirected it wide of the goal.
In their two prior group matches against South Africa and Tunisia, Sinayako had netted goals.