Morocco has qualified for its first FIFA World Cup since 1998 after beating closest Group C challenger Ivory Coast 2-0 away from home on Sunday (AEDT), and Tunisia is through too after a 0-0 draw with Libya.
Needing only a draw to qualify for next year's Russian Federation finals, two first-half goals from Nibal Dirar and Juventus defender Mehdi Benatia ensured the Atlas Lions a World Cup spot. But it was the Moroccans who got the breakthrough when Nabil Dirar's cross evaded everyone and found its way it to the net.
As the final set of matches of CAF World Cup qualification concluded, all five African World Cup slots have been confirmed, including Tunisisa and Morocco.More news: Disney wants to undercut Netflix's price ahead of 2019's streaming war
Despite needing only a point to qualify, the Atlas Lions weren't prepared to sit on a slender lead and doubled their advantage five minutes later when former Bayern Munich center back Medhi Benatia turned in a left wing corner.
Morocco qualified for the first time since the 1998 World Cup.
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.More news: Twitter Halts User Verification, Saying It's 'Broken'
But it proved to be enough and, after missing out in 2010 and 2014, Tunisia will be at the World Cup for a fifth time.
Tunisia needed a draw to pip DR Congo, which began the day three points adrift, to seal top spot in Group A and it duly accomplished that with a 0-0 stalemate at home to Libya.
Libya had been forced to play all of their home games at neutral venues, including Tunisia, because of a Federation Internationale de Football Association ban on internationals in the country, where the security situation is judged unsafe for visiting teams.More news: US Aircraft Carriers to Start Joint Exercise in Western Pacific
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.