Morocco stunned Ivory Coast 2-0 to qualify for the 2018 World Cup, while Tunisia also booked their ticket to Russia on Saturday.
Marc Wilmots' Ivory Coast needed a win at home to qualify for their fourth consecutive World Cup, but two errors by goalkeeper Sylvain Gbohouo put chances of victory out of reach in the first half.
Nabil Dirar scored the opener in the 25th minute with an inswinging cross that went untouched through the box and entered the net. Gbohouo was frozen while expecting Morocco's Khalid Boutaïb to get a touch to the ball, but when he didn't it still crept in at the far post.
And five minutes later Gbohouo was at fault again as he started to come for Mbark Boussoufa's corner into the box but then backtracked, allowing Medhi Benatia to volley home and double the lead.
Serge Aurier had the best chance to score for Ivory Coast in the second half, but he skied his shot over the bar, and Morocco maintained their record of not conceding a single goal in the six games in CAF qualifying Group C.
Morocco return to the world's biggest stage for the first time since 1998.
Meanwhile, Tunisia's goalless draw against Libya proved enough to seal their World Cup spot from Group A.
Tunisia will participate in their fifth World Cup, but first since qualifying for three consecutive tournaments from 1998-2006.
DR Congo were the only team still with a chance to catch Tunisia, but they fell short despite a late 3-1 win over Guinea.
Guinea's Ousmane Sidibe headed into his own net while defending a set piece after the hour mark, but the visitors were able to equalise 10 mintes later when Keita Karamokoba pounced on a loose ball and flicked it over DR Congo goalkeeper Ley Matampi.
Two goals in stoppage time -- a Jonathan Bolingi penalty and a fine Neeskens Kebano strike -- gave DR Congo the victory, but it proved not to matter as Tunisia held on for the draw in the other game to win the group by a single point.
Morocco and Tunisia will join Nigeria, Egypt and Senegal as the African sides in Russia next summer.
Earlier on Saturday, Gabon and Mali shared a goalless draw in the other game in Morocco's Group B, while Yaya Banana headed a stoppage-time equaliser to help Cameroon draw 2-2 in Zambia in another game between already eliminated sides.