Nigeria, Uganda, Mali and Morocco qualified for the 2019 Africa Cup of Nations on Saturday while Libya scored eight goals to keep alive their hopes of also featuring at the finals.
Nigeria drew 1-1 with South Africa in Soweto, Uganda edged Cape Verde 1-0 in Kampala, Mali beat Gabon in Libreville and Morocco went through after rivals Malawi lost in Comoros.
Libya triumphed 8-1 in Seychelles and host South Africa next March on the final matchday needing a win to accompany Nigeria in qualifying from Group E.
The Libyans just missed equalling the record away winning margin for a Cup of Nations qualifier held by Ghana, who won 9-1 in Niger 49 years ago.
A total of nine nations have booked places at the newly-extended 24-team finals with hosts Cameroon, Madagascar, Senegal, Egypt and Tunisia securing berths before this weekend.
Nigeria, the three-time former champions who had failed to qualify for the last two editions, were ahead in South Africa within nine minutes when Buhle Mkhwanazi scored an own goal.
Outstanding South African Percy Tau set up the equaliser for Lebo Mothiba on 26 minutes, but the hosts were fortunate as several contentious offside decisions went against Nigeria.
"A draw feels like a victory because of the heat (32 degrees celsius/90 fahrenheit) and getting little sleep on our overnight flight," said Nigeria coach Gernot Rohr.
Nigerian president Muhammadu Buhari was among those who hailed the Super Eagles for qualifying.
"The president joins millions of football-loving Nigerians in commending the team for their spirited and disciplined performance against a very formidable opponent," a statement said.
South Africa coach Stuart Baxter said: "I am proud that we have taken four points off Nigeria in the group and disappointed that we were not braver during the second half."
Anis Saltou bagged a hat-trick in Victoria as Libya humiliated the Seychelles, whose 188th world ranking is the lowest among the 48 teams in the qualifying competition.
Meanwhile Patrick Kaddu's 79th-minute goal not only assured Uganda of first place in Group L, it opened the door for Tanzania to also qualify.
- 39-year absence - If Tanzania win in Lesotho on Sunday they will return to the African football showcase after a 39-year absence.
An early Moussa Doumbia goal gave Mali a 1-0 victory and left Gabon, who were without injured star Pierre-Emerick Aubameyang, needing a matchday 6 victory in Burundi to qualify from Group C.
A draw will suffice for Burundi, who are ranked 142nd in the world and seeking a first Cup of Nations appearance.
Morocco qualified when Group B rivals Malawi lost 2-1 away to out-of-contention Comoros in Mitsamiouli.
The Comoran victory in the multi-island Indian Ocean state gave Morocco an unassailable six-point advantage over Malawi.
El Fardou Mohamed Ben Nabouhane, who has been playing for Red Star Belgrade in the UEFA Champions League, gave the Comoros a second-minute lead.
Patrick Phiri equalised after 53 minutes and Nasser Chamed scored the winner in the 70th minute on an artificial pitch. Leaders Morocco and second-placed Cameroon qualify from the group, with the latter assured of a place because they are hosting the tournament between June 15-July 13.
Cameroon are involved in the qualifying competition to gain match practice before defending the title they won in Gabon last year by defeating Egypt 2-1 in the final.
Morocco climbed above Cameroon into first place in Group B on Friday after beating them 2-0 in Casablanca thanks to a second-half brace from Hakim Ziyech.
Senegal won 1-0 in Equatorial Guinea with a Luis Meseguer own-goal soon after half-time deciding a dead rubber Group A match in Bata.
Benin missed out on qualification from Group D this weekend after collapsing towards the end of their clash with The Gambia to lose 3-1 after taking the lead in Bakau.
Guinea-Bissau forced a 0-0 Group K draw in Namibia and will compete at successive Cup of Nations tournaments if they beat Mozambique at home in the final round of games.