Morocco and Tunisia qualified for the World Cup on Saturday, taking Africa's last two places.
They'll join Nigeria, Egypt and Senegal as the continent's five representatives at next year's tournament in Russia.
Morocco sealed its place by winning in Ivory Coast 2-0 in what was a straight shootout for the place from Group C.
Tunisia secured the draw it needed, 0-0 at home against Libya, to qualify from Group A and edge out Congo.
The qualification of Morocco and Tunisia signaled an apparent shift in African soccer, giving North Africa three teams at the World Cup and more than any other region for the first time since 1986.
West Africa has dominated Africa's contingent at the World Cup in recent years but some of its big names missed out this time: Ivory Coast, Cameroon and Ghana, all African champions multiple times, won't be in Russia.
Morocco qualified for the first time since the 1998 World Cup.
Tunisia last played at the World Cup in 2006.
For Morocco, Nabil Dirar and Medhi Benatia scored in the space of five minutes in the first half in Abidjan to help send the Moroccans to their first World Cup in 20 years and deny Ivory Coast a fourth straight appearance.
Morocco's win in Abidjan gave coach Herve Renard success over his former team and the country he led to the African Cup title in 2015. Morocco needed just a point from the game to qualify but made sure.
Dirar's in-swinging cross beat everyone and found the corner of the net in the 25th minute. Benatia scored with a first-time shot from a corner five minutes later to seal the victory.
Ivory Coast was already in decline after being eliminated by Renard and Morocco in the group stage of this year's African Cup, where the Ivorians were defending champions. The failure to reach the World Cup after being ever-present since 2006 will put pressure on coach Marc Wilmots.
Tunisia survived some nervous moments in Rades as Libya finished strongly. The Tunisians held on for the draw, though, and it turned out to be a precious point.
Starting the final game three points behind Tunisia, Congo beat Guinea 3-1 in a whirlwind finish, when Congo scored twice in injury time. Had Tunisia lost, the two teams would have finished level on points and goal difference and Congo would have taken the World Cup place for scoring more goals in the qualifying campaign.