Holders Zambia face a tough defence of their Africa Cup of Nations crown next year after being grouped with continental heavyweights Nigeria.
Zambia, who won the title for the first time this year with victory over Ivory Coast in the final, will also take on Burkina Faso and Ethiopia in Group C.
Hosts South Africa will play Cape Verde, who qualified after beating Cameroon, in the tournament’s opening game after the pair were drawn together in Group A.
They will also face neighbours Angola, as well as Morocco.
Ivory Coast will take on north African giants Tunisia and Algeria in Group D, along with a Togo side making their first appearance at the competition since the shootings at the Angolan edition in 2010.
Ghana, four-time winners and one of the favourites again, were drawn in Group B and open up against the Democratic Republic of the Congo, managed by their former coach Claude Le Roy.
Ghana will also face Mali and Niger.
The 2013 Africa Cup of Nations kicks off on January 19, with the final taking place in Johannesburg on February 10.