Ivory Coast handed double trouble in draw
The Ivorians, whose golden generation missed out on 2012 success when they lost to Zambia in a penalty shootout, will meet Algeria and Tunisia in Group D of the 16-team tournament next January19-February 10.
Zambia were also handed a nasty surprise when they were paired with Nigeria, the team universally regarded as the one to avoid by coaches present at Wednesday's draw in Durban.
Hosts South Africa have a potentially tricky start in the opening match against the Cape Verde Islands, the only first time participants at the continental championship.
The match at Soccer City in Johannesburg kicks off the tournament.
Cape Verde, with a population of just over 500,000, shocked Cameroon in the qualifiers earlier this month.
South Africa also meet Morocco, whose potential is widely acknowledged but who crashed out early at the last finals and have recently changed their coach. Angola are the fourth team in Group A.
Zambia, despite having to play the Nigerians, will still be confident of progress to the quarter-finals ahead of Group C's other two sides Burkina Faso and Ethiopia, who return to the finals after an absence of three decades.
"We are confident of coming here again to make history," said Zambia's coach Herve Renard.
"Nobody gave us a chance in 2012 and we stay a small team but we managed to go very far."
The Ivorians start with a match against Togo but then play the two dangerous north African sides in Group D, to be based in Port Elizabeth.
Algeria knocked out their team at the 2010 finals when the Ivorians were also regarded as favourites.
Ghana were drawn as top seeds in Group B and meet Mali, Niger and the Democratic Republic of Congo.
Ghana beat Mali in the group phase at the last finals but then lost to them in the third place play-off.
The Nations Cup is being held 12 months after the last tournament as the Confederation of African Football has switched the hosting of the bi-annual tournament from every even to every odd year.