Karim Dirar and Mehdi Benatia scored one goal each to send Morocco to the 2018 Fifa World Cup after a tensed encounter against Côte d’Ivoire.
The Ivorians needed a win to seal a place in Russia but were stopped by the Atlas Lions.
Leading the group with nine points after five matches, the Moroccans did well to take the lead in the 29th minute to leave the Elephants, on 8 points, chasing the game before they were finally punished later on.
In the other game, Tunisia were held to a 1-1 draw by Libya. With 13 points after five matches, the Carthage Eagles needed to avoid defeat to seal a place in Russia.
In the group’s other game, DR. Congo crashed out despite a 3-1 win over Guinea.
Morocco, Tunisia, Senegal, Egypt and Nigeria will now represent Africa at the global football fiesta next year.