Before Saturday, the trio of Nigeria, Egypt and Senegal had booked their tickets before the two North African countries also came on board to Russian Federation.
Cote d'Ivoire needed an outright win to qualify while a draw would still have been enough for Morocco.
Morocco returns to the world's biggest stage for the first time since 1998.
The appearance in Russian Federation will be their fifth.
Tunisia booked their place in next year's World Cup finals after securing a point from a goalless draw at home against their neighbors Libya.
Starting the final game three points behind Tunisia, Congo beat Guinea 3-1 in a whirlwind finish, when Congo scored twice in injury time. Before today's matches, Morocco had 9 points while the Ivorians had 8 points; meaning the victor of the match would qualify.
Tunisia also qualified on Saturday after drawing 0-0 with Libya.
The first blow came when an intended cross from Dirar went over an Ivorian defender and a Moroccan attacker and slipped past goalkeeper Sylvain Gbohouo into the far corner.
Tunisia dominated possession at the Stade Olympique, but unpredictable Libya defended resolutely, creating an increasingly tense atmosphere.
Guinean Ousmane Sidibe conceded an own-goal after 61 minutes and Keita Junior levelled just three minutes after coming off the bench.
Congo produced a late rally to secure victory with a penalty from Jonathan Bolingi in stoppage time before Fulham winger Neeskens Kebano netted a third, but it was all to be in vain as the final result filtered through from Rades.