Johannesburg - Bafana Bafana are placed in Group D as the African qualifiers were drawn together on Friday from which the winners go to the 2018 FIFA World Cup in Russia.
Group B was completed by Zambia, shock winners of the 2012 Africa Cup of Nations, after a one-hour ceremony in Cairo.
Cameroon (seven appearances) and Nigeria (five) are the most successful African countries in World Cup qualifying and Algeria (four) have also done well.
Famed French coach Herve Renard, the only man to win the Cup of Nations with two countries, is now in charge of Morocco and they will come up against his former team, Ivory Coast, in Group C.
This mini-league has a distinct French flavour with Michel Dussuyer coaching the Ivorians and Alain Giresse in charge of Mali. Gabon compete the line-up.
Tunisia and the Democratic Republic of Congo look the strongest teams in Group A, which includes Guinea and Libya.
Egypt face Ghana, who beat them 7-3 in a 2014 World Cup play-off, in Group E along with Congo Brazzaville and Uganda.
Senegal will be expected to top Group D with Cape Verde, South Africa and Burkina Faso their rivals.
The first match day is scheduled for October 3-11 this year and the last for November 6-14 2017.
Each of the five group winners qualify for the 2018 World Cup.
Before the draw, the audience stood silent for a minute in memory of Nigerian football legend Stephen Keshi, a Cup of Nations winner as a player and coach, who died this month at the age of 54.
The weeks preceding the event were overshadowed by constantly changing FIFA African rankings, on which the seedings were based, due to protests from unnamed national football associations.
After monthly FIFA rankings covering all the continents were released in early June, an updated version covering only Africa was issued following Cup of Nations match day five qualifiers.
Further protests led to fresh rankings being issued three days before the draw only for those to be declared null and void by a FIFA emergency committee.
The seedings used in the draw were those released after the Cup of Nations qualifiers with Tunisia the big winners, moving from second to first seeds.
Egypt (first to second seeds) and Guinea and Cameroon (second to third) were the chief losers amid growing confusion.
Group A: Tunisia, Democratic Republic of Congo, Guinea, Libya
Group B: Algeria, Nigeria, Cameroon, Zambia
Group C: Ivory Coast, Mali, Morocco, Gabon
Group D: Senegal, Cape Verde, South Africa, Burkina Faso
Group E: Ghana, Egypt, Congo Brazzaville, Uganda
1: Oct 3-11 2016
2: Nov 7-15 2016
3/4: Aug 28-Sept 5 2017
5: Oct 2-10 2017
6: Nov 6-14 2017
Note: Group winners qualify for 2018 World Cup in Russia.