Peter Shalulile grabbed a brace and Deon Hotto an assist as Namibia claimed a 2-1 victory over Guinea.
However, it was a little too late for the Brave Warriors, who finish on nine points, two behind Guinea and three behind Mali, who top the group.
Chad finish bottom of the group without a single win to their name.
Tanzania finished their qualifying campaign on a winning note with a 1-0 win over Libya.
Simon Msuva scored the only goal of the game in first-half stoppage time as the Taifa Stars finish in third with seven points and Libya in last with three points.
Tunisia beat Equatorial Guinea 2-1 with both sides having already secured progression in the last round.
Seiffedine Jazi opened the scoring for the Eagles of Carthage in the fourth minute before Carlos Akapo put the ball into his own net in the 52nd minute.
Firas Chaouat scored an own goal to give Equatorial Guinea a glimmer of hope but the hosts held on for the win.
Tunisia finish comfortably top of the group with 16 points, while Equatorial Guinea end with nine points in second.
Ghana clinched top spot in Group C with a 3-1 triumph over Sao Tome and Principe.
Nicholas Opoku, Jordan Ayew and Baba Rahman scored for the Black Stars, while Iniesta pulled a consolation goal back for the Islanders.
Ghana qualify in first position on 13 points and are joined by Sudan in second position on 12 points after they beat South Africa 2-0. Bafana Bafana finish in third with ten points, while Sao Tome and Principe picked up no points.