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 the Comoros.
Libya triumphed 8-1 in the 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 now 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 saluted 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.
A Patrick Kaddu goal on 79 minutes not only assured Uganda of first place in Group K, it opened the door for Tanzania to also qualify.
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 with one matchday left.
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 June 15-July 13 tournament.
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 Friday after beating them 2-0 in Casablanca thanks to a second-half brace from Hakim Ziyech.