South Africa thumped Botswana 4-1 in their final group A fixture but it was not enough to see them through to the next round of qualifying.
Bernard Parker scored a late brace to add to first-half strikes from Kermit Erasmus and Dean Furman on Saturday.
However, the South Africans finished second in their group behind Ethiopia, after they beat Central African Republic 2-1 to seal their place in the final qualification round.
Jerome Ramatlhakwane had briefly given Botswana hope in the second half, but Parker's double ensured that they finished third in the group, six points adrift of Ethiopia.
South Africa made five changes to the side that had lost to Ethiopia in their last qualifier in June.
Erasmus, Thabo Matlaba, Kagisho Dikgacoi, Bongani Khumalo and Tokelo Rantie all came in, with Tebogo Langerman, Reneilwe Letsholonyane, Mulomowandau Mathoho, Thuso Phala and May Mahlangu making way.
For Botswana, Jackie Mothatego, Galabgwe Moyana and Mogogi Gabonamong replaced Dirang Moloi, Phenyo Mongala and Obuile Ncenga from the team that defeated Central African Republic in their previous qualifier.
Both sides needed a win to have any chance of progressing to the next stage of qualifying, and it was the home side who started the stronger, as Dikgacoi was denied twice by Botswana goalkeeper Kabelo Dambe in the seventh minute.
Siphiwe Tshabalala fired a free-kick over the bar 10 minutes later as South Africa continued to press.
In the 27th minute, Erasmus gave South Africa the lead.
Gabonamong conceded a cheap corner, from which Parker flicked the ball on leaving Erasmus with the simple task of nodding the ball home for his first international goal.
Kabelo Dambe then brilliantly kept out Parker's effort, but South Africa were not to be denied and in first-half stoppage time Doncaster Rovers midfielder Furman broke forward and tucked a low finish beyond the goalkeeper and in off the post.
The home side began the second period the same way they ended the first, as Dambe had to be on hand to deny both Rantie and Matlaba.
With 17 minutes to go, Ramatlhakwane gave Botswana hope when he rose to head beyond Itumeleng Khune, but 10 minutes later Parker restored South Africa's two-goal advantage.
Substitute Moloi brought down Rantie outside the box and Parker stepped up to send the ball over the wall and beyond Dambe.
A minute from time, Parker claimed his second from the penalty spot after substitute Daine Klate was felled in the area to seal a resounding, if ultimately academic, victory for South Africa.comments