Tunisia qualified for the 2018 World Cup despite being held 0-0 at home by Libya in their final Group A qualifier on Saturday.
The Tunisians secured a fifth appearance at the tournament by topping the table with 14 points, one more than the Democratic Republic of Congo.
DR Congo scored twice in stoppage time through Jonathan Bolingi and Neeskens Kebano to defeat Guinea 3-1 in Kinshasa.
Goals from defenders Nabil Dirar and Medhi Benatia handed Morocco a 2-0 away win over the Ivory Coast and booked a return to the finals for the first time in two decades.
Morocco needed only a draw in their last group game to finish top of the Group C standings ahead of the Ivorians, who had to win to clinch a fourth successive World Cup finals appearance.
But after weathering an early storm, including a potential penalty call, Morocco scored two goals in the space of five minutes to put themselves on their way to the finals, in which they last appeared in 1998.
Morocco completed the campaign without conceding a goal, finishing on 12 points, four ahead of the Ivorians. Gabon had seven and bottom-placed Mali five.
Yves Banana scored in stoppage time to salvage a 2-2 draw for Cameroon in Zambia at the end of a disappointing World Cup Group B campaign for the African champions.
Zambia teenager Patson Daka opened the scoring and set up Brian Mwila to put the hosts ahead again after Cameroon had levelled before half-time in the central city of Ndola.
Andre-Franck Zambo Anguissa scored the first Cameroon equaliser and Banana’s glancing header restored parity a minute into additional time.
The result meant the “Indomitable Lions” finished third in Group B with seven points, having won only one of their six matches, at home to off-form Algeria last month.