The Gambia qualified for their first ever Africa Cup of Nations tournament when beating Angola 1-0 at home, joining Comoros, Gabon, Ghana and Egypt in qualifying on Thursday.
Assan Ceesay scored the all-important match winner after an hour, enabling The Gambia to clinch one of the two places from Group D.
The other slot was secured by Gabon who beat DR Congo 3-0 to ensure that they return to the finals after missing out on the 2019 edition.
Pierre-Emerick Aubameyang, Denis Bouanga and Aaron Boupendza scored the goals for the Panthers.
The Congolese, meanwhile, miss out for the first time since 2012, having appeared at the last four tournaments.
Elsewhere, Egypt drew 1-1 in Kenya to secure the point they needed in Group G to qualify for the finals in Cameroon.
The Pharaohs now have nine points, level with Comoros, while Kenya move up to four and join Togo, who have just the two, in being eliminated with one round of games still to go.
Egypt opened the scoring in Nairobi after just two minutes through playmaker Magdi Afsha before Abdallah Hassan equalised midway through the second half for the hosts, who had Johnstone Omurwa sent off.
Comoros qualified earlier on Thursday when drawing 0-0 at home to Togo to also reach their first Nations Cup finals.
Teams that have never reached the tournament before have profited from the decision to expand the Nations Cup from a 16- team event to one featuring 24 teams for the 2019 finals onwards.
Reaching the finals has rarely been a problem for Ghana who drew 1-1 in South Africa to make it through from Group C.
Mohammed Kudus gave Ghana, playing at the stadium where they lost their infamous 2010 World Cup quarter-final against Uruguay, 180 seconds into the second half with Percy Tau replying just four minutes later.
The Black Stars, who have contested all but one of the last 15 tournaments, move up to ten points, level with South Africa who travel to Sudan, who have nine points, on the sixth and final day.
With Ghana having a better head-to-head record against both the Sudanese and Bafana Bafana, there is no scenario whereby the four-time African champions cannot go through.
And Zimbabwe won 1-0 away in Botswana to give themselves a great chance of making it out of Group H.
Half the teams at next year’s finals are now known with Comoros, Gabon, The Gambia, Ghana and Egypt joining Algeria, Burkina Faso, Guinea, Mali, Senegal, Tunisia and hosts Cameroon in January’s tournament.