North African nations Morocco and Tunisia took contrasting routes as they qualified for the 2018 World Cup in Russia.
Morocco scored twice within five minutes through Nabil Dirar and Medhi Benatia during the opening half to triumph 2-0 in the Ivory Coast and win Group C.
The “Atlas Lions” are going back to the tournament for the first time since 1998 after finishing with 12 points, having not conceded a goal during the six-match group campaign.
Ivory Coast, who never looked like recovering from the first-half blows, came second with eight points followed by Gabon with six and Mali with four.
Tunisia could not break down neighbours Libya in Rades on the outskirts of Tunis and had to settle for a 0-0 draw that was just enough to see them first over the finishing line.
With second-place Democratic Republic of Congo netting twice in stoppage time to defeat Guinea 3-1 in Kinshasa, only one point separated the top two.
Unbeaten Tunisia collected 14 points to book a first World Cup appearance since 2006, DR Congo had 13, Libya four and Guinea three.
Senegal sealed a place in Russia Friday by winning 2-0 in South Africa and the other two African qualifiers, Nigeria and Egypt, secured slots last month.
Ivory Coast had the first chance at a packed 35,000-seat Stade Felix Houphouet-Boigny but veteran Gervinho blazed over with only the goalkeeper to beat from inside the box.
It was to prove a costly miss for the home side, who had to win after beginning the match one point behind a Moroccan team coached by former Ivorian handler, Frenchman Herve Renard.
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.
Rattled Ivory Coast fell further behind as they failed to cut off a corner and Juventus defender Benatia struck a first-time shot into the net.
Belgian coach Marc Wilmots tried to revive the lacklustre Ivorians by introducing Ghislain Konan at half-time and Maxwel Cornet and veteran Salomon Kalou during the second half.
But Morocco comfortably contained the hosts in a match that threatened to boil over at times with Dirar and Crystal Palace flyer Wilfried Zaha wrestling each other to the ground.
Tunisia dominated possession at the Stade Olympique, but unpredictable Libya defended resolutely, creating an increasingly tense atmosphere.
Had Tunisia lost, they would have ceded top place to DR Congo, who finished strongly to overcome Guinea 3-1 at the Stade des Martyrs.
Guinean Ousmane Sidibe conceded an own-goal after 61 minutes and Keita Junior levelled just three minutes after coming off the bench.
Jonathan Bolingi put the Congolese Lions ahead again two minutes into additional time and Neeskens Kebano added a third goal almost immediately.