Mauritania claimed a 1-0 win over Central African Republic in their final Group E encounter on Tuesday evening.
Aboubakar Kamara scored the only goal of the game in first-half stoppage time.
Mauritania finish in second and thus qualify, while Central African Republic finish bottom.
Ivory Coast secured a 3-1 victory over Ethiopia to end their qualifying campaign in winning fashion.
Wily Boly, Frank Kessie and Jean Kouassi got on the scoresheet for the Elephants, while the Ethiopians scored through Getaneh Kebede.
Despite the match not finishing due to the referee collapsing, Ethiopia join the Elephants at next year's tournament.
Madagascar missed out on a chance to qualify for the continental showpiece after being held to a goalless draw by Niger in Group K.
The Madagascans finished just one point behind second-placed Ethiopia and would have claimed a spot if they had won this fixture.
Guinea-Bissau comfortably saw off Congo with a 3-0 victory in Group I to qualify for the Africa Cup of Nations.
Piqueti, Federic Mendy and Jorginho did the damage for the hosts.
Guinea leapfrog Congo into second and secure qualification at the expense of their opponents.
Nigeria got the better of Lesotho with a 3-0 triumph in Group L.
Victor Osimhen, Oghenekaro Etebo and Paul Onuachu found the back of the net for the Super Eagles.
Gernot Rohr's side top the group while Lesotho finish bottom.
Senegal and Eswatini could not be separated as the nations played to a 1-1 draw in Group I.
Jean Paul Figareido opened the scoring in the 53rd minute but in the sixth minute of second-half stoppage time Cheikhou Kouyate netted a dramatic last-gasp equaliser.
The Teranga Lions finish at the summit, while Eswatini prop up the table.
Cameroon and Rwanda played to a goalless draw in their final Group F clash on Tuesday night.
The visitors were reduced to 10 men when goalkeeper Olivier Kwizera was shown a straight red in the second half.
Cape Verde qualified for Afcon after claiming a 1-0 win over Mozambique on Tuesday night.
An own goal from Faisal Bangal sealed maximum points and second spot in Group F.
Morocco defeated Burundi 1-0 in their final Group E encounter on Tuesday night.
Sevilla forward Munir El Haddadi netted his first goal for the Moroccans to secure maximum points.