Hosts Morocco will play Mauritania, Sudan and Guinea in Group A of the 2018 African Nations Championship.
Organisers the Confederation of African Football (CAF) confirmed the draw for next year's tournament today.
Group A will take place in Casablanca at the Stade Mohamed V, with the event running from January 13 to February 4.
Defending champions Democratic Republic of Congo have not qualified for 2018 so will be unable to reclaim their title.
Group B, to be played at the Stade de Marrakech, will feature Ivory Coast, Zambia, Namibia and Uganda.
Liberia, Nigeria, Rwanda and Equatorial Guinea will play in Group C at the Stade Ibn Batouta in Tangier.
The Stade Adrar in Agadir will host Group D which is home to Angola, Cameroon, the Republic of Congo and Burkina Faso.
The African Nations Championship only features players on the books of club sides from the continent.
The top two in each group will make the quarter-finals.
Last month, Morocco was named as the replacement for Kenya as tournament host.
The North African country, which is bidding to stage the 2026 World Cup, was chosen over Equatorial Guinea at an emergency meeting of the CAF Executive Committee in Lagos.
Ethiopia had also expressed an interest after Kenya were stripped of the competition but failed to secure the necessary Government support to mount a bid.
Kenya lost the hosting rights for the tournament due to concerns over infrastructure.