Nigeria and South Africa were among the heavyweight casualties on the penultimate day of African Nations Cup qualifying as Angola, Ghana, Guinea, Mali, Tunisia,Zambia and Niger all made it through to next year’s tournament.
War-torn Libya also qualified as one of the two best runners-up but Nigeria missed out on the finals after Guinea scored a 95th minute equaliser to draw 2-2 in Abuja.
South Africa also failed to qualify after being held to a goalless home draw by Sierra Leone.
Libya’s triumph came after a 0-0 draw with Zambia in Chingola and caps a campaign that saw them forced to play five of their six group matches away and yet still finish unbeaten.
“This is for all Libyans, for our revolution,” said 39-year-old goalkeeper Samir Aboud, whose agile saves kept his side’s goal intact in their Group C clash.
The other spot reserved for second-placed finishers in the four team groups will be decided on Sunday when the last set of matches are played. Sudan are best placed to qualify after Saturday’s matches despite losing 2-0 at home to Ghana.
South Africa’s failure to beat Sierra Leone left them level on points with their opponents and Niger.
Niger, who lost 3-0 in Egypt, finished top of a mini league table of head-to-head results between the three countries to qualify for the finals for the first time.
South Africa embarrassingly celebrated what they assumed was qualification at the end of their match in Nelspruit, having been unclear about the rules.
South Africa’s fans danced in the streets as the state-run broadcaster also thought their team had qualified.
Their football association president, Kirsten Nematandani, went on television to erroneously congratulate his players on reaching the 2012 tournament in Equatorial Guinea and Gabon.
Guinea substitute Ibrahima Traore’s stoppage time goal ensured a massive blow for the continent’s most populated country as twice champions Nigeria failed to qualify for the Nations Cup for the first time since 1986.
Nigeria needed a 1-0 win to finish top of Group B but were behind 10 minutes after halftime to Ismael Bangoura’s goal, only to fight back for a 2-1 lead before Guinea’s dramatic late goal.
There was also heartbreak for Uganda, who were top of Group J ahead of their derby with Kenya before a 0-0 draw in Kampala allowed Angola to sneak into first place.
World Cup quarter-finalists Ghana went into their Group I match in the Sudan level on points with the hosts but showed their quality with first-half goals from former Sunderland pair Asamoah Gyan and John Mensah to win 2-0 in Khartoum.
In spite of the defeat, Sudan can only be dislodged from taking the final best group runners-up spot if the Central African Republic upset Algeria away on Sunday to top Group D and Morocco finish behind them on goal difference to qualify.
Botswana, Burkina Faso, the Ivory Coast and Senegal had already qualified before the weekend matches.
Nations Cup holders Egypt and four-times winners Cameroon were already out of contention before the last round of qualifiers for the January 21 to February 12 tournament.