Cameroon and Nigeria reached the World Cup finals on Saturday but the last available African berth for the 2010 finals was left hanging by a dramatic last-gasp goal in Cairo.
Cameroon set an African record of six World Cup qualifications after beating Morocco 2-0 away to ensure their place in South Africa next June. Nigeria saw their fortunes turn around on as they came from behind to win their group.
Nigeria recovered from a halftime deficit to beat Kenya 3-2 away and overhaul Tunisia whose hopes crumbled in a lacklustre 1-0 defeat in Mozambique in their last Group B game.
Egypt and Algeria failed to settle the outcome in Group C and will play off in neutral Sudan on Wednesday.
Emad Moteab's 95th minute goal in Cairo saw Egypt beat Algeria 2-0 to ensure a deadlock at the head of the standings.
Algeria were just a minute away from holding out for their first World Cup finals appearance in 24 years when Moteab struck with a looping header at the back post.
He had come on a substitute for Amr Zaki who had given Egypt the lead in the second minute of the game.
Samuel Eto'o scored his ninth goal of the qualifying campaign as Cameroon made sure of top place in Group A with a win over injury-hit Morocco.
SLIM HOPES
Achille Webo had handed the visitors a 1-0 halftime lead in Fes where Morocco were opening a new stadium. Cameroon eventually finished four points clear of Gabon whose 1-0 loss at Togo put paid to their slim hopes.
Nigeria finished one point ahead of Tunisia as the outcome of Group B see-sawed between the two countries. Their last matches were staged simultaneously.
Nigeria looked out of the running as they trailed at halftime to Kenya but two goals from Obafemi Martins and one from Yakubu Aiyegbeni enabled them to turn around their fortunes and ensure an emotive win in Nairobi.
"This is a typical Nigerian side which you can never rule out when it is faced with adversity," coach Shaibu Amodu told reporters.
Tunisia would have qualified had they won in Maputo but showed little attacking initiative and conceded a late goal to Dario as Mozambique kept up their unbeaten home record in the 2010 qualifiers.
Tunisia had qualified for the last three World Cup finals.
Saturday's matches also saw the final places at January's African Nations Cup finals determined with Malawi, Mozambique, Togo and Zambia grabbing the last available berths.