Striker Kelechi Iheanacho scored a stoppage-time winner as Nigeria beat Sierra Leone 3-2 in the Africa Cup of Nations qualifiers to become one of four countries on Sunday to be added to the list of finalists for next year's tournament.
Guinea Bissau also qualified from Group A, as Sierra Leone's hopes of catching them were ended, while the Cape Verde Islands are through from Group B and Mali from Group G.
- Stream on ESPN+: LaLiga, Bundesliga, more (U.S.)
They join hosts Ivory Coast, holders Senegal, Algeria, Burkina Faso, Egypt, Equatorial Guinea, Morocco, South Africa, Tunisia and Zambia in the finals in January.
Iheanacho's winner brought relief to Nigeria who had let a 2-0 lead, courtesy of a Victor Osimhen double, slip as Sierra Leone made a gutsy comeback to 2-2 and came close to scoring a third.
But their slim hopes were ended by a simple back post tap-in by the Leicester City striker just before the final whistle.
Guinea Bissau, who had beaten Sao Tome e Principe on Wednesday, were then also guaranteed a top two finish and a fourth successive finals appearance.
Cape Verde, who also draw heavily on players from their migrant population in Portugal, beat Burkina Faso 3-1 at home to book their place.
Former Manchester United midfielder Bebe opened the scoring before goals from Joao Paulo and Cle ensured progress.
Mali won 2-0 away against Congo to qualify for a ninth successive finals with Ibrahima Kone and Nene Dorgeles scoring in the final 30 minutes in Brazzaville.
The return of Pierre-Emerick Aubameyang for Gabon was a bid to help them qualify at the expense of the Democratic Republic of Congo but they lost 2-0 at home instead.
DR Congo's goals came from London-born Aaron Tshibola and Tanzania-based striker Fiston Mayele and they now top Group I.
Ghana would have qualified from Group E had they won in Madagascar but were held to a goalless draw and must wait for the last round of qualifiers in September to win their place.
Victory for both Mozambique and Tanzania also enhanced their chances of going to the finals with one group game left.
Algeria are the only country left with a 100% record in the qualifiers as they made it five wins out of five by beating Uganda 2-1 away with Mohamed El Amine Amoura netting both and Riyad Mahrez providing an assist.
The top two teams in each of the 12 qualifying groups qualify for the finals. There are three more matches to complete the fifth rounds of qualifiers, which will all be played on Tuesday.