Niger have qualified for their maiden Africa Cup of Nations final despite losing 3-0 in Egypt on Saturday.
Group G rivals South Africa or Sierra Leone would have qualified had either won in Nelspruit but it ended 0-0.
Nonetheless, the Bafana Bafana squad celebrated their victory in the errant belief that they had qualified.
Niger, South Africa and Sierra Leone all ended with nine points, but Niger qualify thanks to their superior head-to-head record against their rivals.
"Niger have qualified," Confederation of African Football secretary-general Hicham El Amrani confirmed to BBC Sport.
South African joy in Nelspruit and around the country turned to despair after the realisation that they could not qualify as a best runner-up either.
Bafana players even went on a lap of honour after the final whistle, dancing in formation in front of cheering fans while coach Pitso Mosimane hugged members of his technical team.
Captain Siphiwe Tshabalala had two opportunities to put the hosts ahead but shot wide in the 62nd minute before Sierra Leone goalkeeper Christian Caulker pushed a late free-kick away.
In between, South Africa goalkeeper Itumeleng Khune tipped Sheriff Suma's shot over the bar to preserve a draw.
Few would have predicted that Niger would qualify from Group G when the draw for the 2012 Nations Cup was made.
Their opening 2-0 defeat in South Africa seemed to confirm this, but the Mena sent shockwaves across the continent when beating reigning African champions Egypt 1-0 in their second game.
In fact, their qualification was entirely based upon their results at home - which produced three wins out of three.
This resulted in their total tally of nine points, for they never managed to avoid defeat on their travels.