South Africa and Nigeria missed out on places at the Africa Cup of Nations on a decisive day of qualifying matches on Saturday.
2010 World Cup hosts South Africa failed to reach next January's tournament after only managing a goalless draw against Sierra Leone.
With Niger losing 3-0 in Egypt, a win for either side in Nelspruit would have sent them through.
But the draw meant all three teams finished tied with nine points and, as Niger finished with the best record in matches involving the trio, it was they who topped Group G and sealed their place in Equatorial Guinea and Gabon.
Marwan Mohsen scored twice in the second half, sandwiching Mohamed Salah's effort, to give Egypt victory over Niger but it was not enough to prevent them finishing bottom of the pool or Niger heading to their first Africa Cup of Nations.
Ahead of Sunday's matches, 14 of the 16 qualifiers are decided: the two host nations; nine of the 10 group winners; Tunisia, who as runners-up in five-team Group K also qualify; and Libya, who claimed one of the two other best runners-up spots.
The winners of Group D and the other best runners-up will be decided on Sunday.
Nigeria missed out as a last-minute goal from Ibrahima Traore gave Guinea a 2-2 draw in Abuja and sent them through to the finals as Group B winners.
Ismael Bangoura put Guinea ahead after 63 minutes, but Nigeria fought back through Victor Obinna and Ike Uche before Traore's late contribution.
Like South Africa, Nigeria cannot claim one of the two best runners-up spots either.
The other game in the group saw Ethiopia beat Madagascar 4-2.
Gyan on target
Ghana sealed their place in the finals as a 2-0 win in Sudan saw them top Group I ahead of their hosts.
First-half goals from Asamoah Gyan and John Mensah were enough to see off Sudan, who could still qualify as runners-up depending on Sunday's results.
Congo won 1-0 in Swaziland in the group's other game.
Libya secured one of the two best runners-up spots as a 0-0 draw in Zambia saw them qualify along with their hosts, who won Group C.
Also in Group C, Mozambique were 3-0 winners over Comoros.
A 2-0 win for Angola in Guinea-Bissau saw them pip Uganda to top spot in Group J.
Goals from Manucho and Mateus saw Angola overtake Uganda, who were held to a goalless draw at home by Kenya.
Mali claimed a 2-2 draw in Liberia to finish top of Group A ahead of Cape Verde due to their superior head-to-head record.
Cape Verde were 2-1 winners over Zimbabwe, who would themselves have advanced with a win.
Tunisia beat Togo 2-0 to ensure they qualified as runners-up in Group K, the only five-team pool, behind Botswana.
Goals from Walid Hicheri and Saber Khelifa sealed the win for Tunisia, meaning they finished two points clear of Malawi, who drew 2-2 in Chad.
The final game in Group F finished as a 1-1 draw between Gambia and Burkina Faso, who had already qualified.
With Ivory Coast already having won Group E, Sunday's matches will decide who tops Group D and who claims the remaining runners-up spot.