Morocco was seeded in pot 1 during the draw conducted in Johannesburg.
The 2023 Africa Cup of Nations will take place in Côte d'Ivoire in May and June next year.
Here follow the full results of the draw for the 2023 Afcon qualifying groups:
Group A: Nigeria, Sierra Leone, Guinea-Bissau, Sao Tome e Principe or Mauritius
Group B: Burkina Faso, Cape Verde, Togo, Eswatini
Group C: Cameroon, Kenya, Namibia, Burundi
Group D: Egypt, Guinea, Malawi, Ethiopia
Group E: Ghana, Madagascar, Angola, Central African Republic
Group F: Algeria, Uganda, Niger, Tanzania
Group G: Mali, Congo Brazzaville, Gambia, South Sudan
Group H: Ivory Coast (hosts), Zambia, Comoros, Lesotho
Group I: Democratic Republic of Congo, Gabon, Mauritania, Sudan
Group J: Tunisia, Equatorial Guinea, Libya, Botswana
Group K: Morocco, South Africa, Zimbabwe, Liberia
Group L: Senegal (holders), Benin, Mozambique, Rwanda.