Nigeria, the World Under-17 champions, failed to reach next year's Under-20 Africa Cup of Nations in Zambia, falling to a shock 3-4 home defeat to Sudan who sealed a famous qualification.
Nigeria hosted Sudan in Lagos leading 2-1 from the first leg, but Sudan - who had a man sent off - came from behind to level the tie 5-5 overall and progress on away goals.
Senegal qualified on Friday after eliminating Ghana, and South Africa went through with a win over Lesotho.
Nigeria, who have enjoyed much success in youth competitions both in Africa and globally, went into the return leg of their qualifier against Sudan as favourites to win.
Not only did they hold a 2-1 advantage from the first leg, they also had 15 members of Nigeria's triumphant Under-17 World Cup winning side from Chile 2015 in their squad - including the top scorer from that tournament, Victor Osimhen (pictured).
The game in Lagos was played in wet conditions, and despite a heavy downpour the Flying Eagles started off well with Samuel Chukwueze putting the hosts ahead after 15 minutes to make it 1-0.
Just six minutes later, Sudan equalised through Amghd Ahmed, but Nigeria again went in front when Bamgboye followed up a cross from Chukwueze and tapped in to make it 2-1.
But Sudan's dogged determination helped them equalise again through Halid Abdamuleem to make it 2-2 at the break, 4-3 to Nigeria on aggregate.
With the pressure mounting on Nigeria, Sudan took advantage and stunned the hosts with a goal after 56 minutes from Walaadihh Musa to make it 3-2 to Sudan and 4-4 overall.
Just five minutes later, the goal-scorer Musa was sent off for dissent.
Nigeria took advantage immediately with Orji Okonkwo scoring after 67 minutes to make it 3-3 on the day, but still Sudan ploughed on despite being down to ten men and losing 5-4 on aggregate.
Their reward came seven minutes from time when Halid Abdamuleem scored a shock winner for Sudan, his second of the game.
Nigeria were unable to respond, with Sudan famously holding on to win 4-3 and progress on away goals after the tie ended 5-5 on aggregate.
Nigeria had already endured a torrid week after the players threatened to boycott the game due to unpaid allowances and poor treatment.
It took the late intervention of Nigeria Football Federation vice president Seyi Akinwunmi to avert the crisis, with him donating $17,000 to the team.
Another country missing from Zambia 2017 will be Ghana who fell to a 3-2 aggregate defeat to Senegal on Friday.
Ghana are the only African team to have won the Under-20 World Cup, lifting the trophy in 2009 with a penalties victory over Brazil in the final in Egypt.
However, Senegal's 3-1 advantage from the first leg in Dakar proved decisive, with Ghana failing to claw back the deficit.
Ghana gave the home fans some hope when they went 1-0 up, but Senegal's dogged defence stopped them from adding to the tally, with Senegal becoming the first side to join the hosts Zambia at next year's finals.
South Africa will also be at the finals after a 3-0 win over Lesotho on Saturday, winning 5-0 on aggregate.
Goals from Liam Jordan, Sibongakonke Mbatha and Sidney Mtshweni gave Amajita a comfortable victory.
In other matches to be concluded this weekend, Angola host Egypt later on Saturday. Egypt lead 1-0 from the first leg.
Then on Sunday, Guinea host The Gambia and Burkina Faso travel to play Mali - both those games are goalless after the first leg.
Cameroon hold a 3-0 advantage over Libya - a game which is being played in Tunisia on security grounds.
In total, seven teams will join hosts Zambia at the finals next year.