Zambia pulled off a shock 3-1 win over South Africa in Cape Town to qualify for the Nations Cup as winners of Group Eleven.
Zambia were 3-0 up in Cape Town after 20 minutes
South Africa have also qualified, as results in other groups guaranteed them one of the places reserved for the best runners-up.
The group was decided on the head-to-head record between the two teams, and South Africa had won 1-0 away to Zambia.
Chris Katongo scored a hat-trick, netting in the ninth, 19th and 20th minutes.
Defensive errors from South Africa were factors in all three goals.
On his Bafana Bafana return, Benni McCarthy pulled one back in the 50th minute, and Delron Buckley hit the post a minute later.
But South Africa needed two more goals to finish top of the group, and the outcome is a worry for the 2010 World Cup hosts.
In N'Djamena, Chad needed a 90th minute goal to draw 1-1 with Congo.
Toussaint Mayimbi put Congo ahead after six minutes, with the equaliser coming from Leger Mbaiguidim.
Chad ended the campaign with two draws and four defeats, while Congo's seven points left them four adrift of Zambia and South Africa.