Stung by an embarrassing mix-up that saw its players celebrating with a lap of honor when they had actually failed to qualify for the African Cup of Nations, South Africa appealed to the continent's top football body on Sunday and insisted it should be at next year's tournament.

The South African Football Association said it had lodged an official appeal with the Confederation of African Football, challenging CAF's interpretation of the rules after Niger went through ahead of South Africa and Sierra Leone when all three teams finished on nine points.

South Africa mistakenly believed it had qualified as Group G winner on goal difference, with players dancing in front of cheering fans and coach Pitso Mosimane hugging members of his technical staff following Saturday's 0-0 home draw with Sierra Leone at Mbombela Stadium.

CAF later announced Niger had, in fact, gone through to the 16-team event in Gabon and Equatorial Guinea because of its better record in head-to-head games with the other two teams, stunning South Africa.

''We have noted that CAF has announced that Niger has qualified in our group, despite South Africa finishing on top of the group in terms of goal difference which is the universally recognized means of separating teams who are equal on points,'' SAFA said in its letter to CAF.

South Africa's association added it would explain its objection more fully shortly, but said it had taken legal advice on the case and ''found precedent where competition rules that are patently unfair have been overturned on appeal.''

SAFA also included a group table in its statement, putting South Africa on top from Sierra Leone and then Niger, with its superior goal difference highlighted.

Mosimane said he had adjusted his tactics during the final qualifying game against Sierra Leone in the northern city of Nelspruit to ensure South Africa held on for a draw, thinking that would qualify it for the African championship with news that Niger was losing 3-0 in Egypt.

Mosimane sent on defensive players in the second half and Bafana protected the 0-0 scoreline which they believed would take them to their first Cup of Nations since 2008, having also missed out last year.

At the final whistle, goalkeeper Itumeleng Khune led a group of players who danced for supporters at all four corners of the 2010 World Cup stadium and other team members held up banners. In Cairo, Niger players didn't realize they had reached the African Cup for the first time in the country's history and trudged off the field after their defeat.

Mosimane was suddenly unsure of his team's fate in a post-match interview, but was told by television reporters that South Africa had qualified.

''Let's hear what CAF says,'' Mosimane said in the TV interview. ''Did we qualify? What do you think? If we've qualified I'm very happy. I don't know.''

After learning South Africa had missed out, Mosimane criticized African football's organization in his post-match news conference and said it was hard for teams to play on the continent because of poor planning. He called football in Africa ''a jungle.''

''I'm confused,'' Mosimane said. ''Just have a look at the table of the group now and see who is top of the group. Put points on the table now and tell me, are you going to put Niger on top now, even with our better goal difference?

''It's very sad for South Africa because the country deserves to be in next year's African Cup of Nations. I feel like I have failed. The European and South American formats are so much better because everything is running smooth, but it's very difficult to play in Africa.''

CAF released a statement on Saturday to confirm Niger had qualified instead of South Africa, quoting from its rules which were widely published before the start of the final round of qualifiers.

It said Niger progressed because it gained six points in games against South Africa and Sierra Leone. The other two only collected five in the head-to-head contests.

But, SAFA insisted it had a case and said its president had told the players after the match that the association would fight for the team to be allowed to go to Africa's top tournament, which runs Jan. 21-Feb. 12.

''Do not despair, all is not lost,'' SAFA President Kirsten Nematandani said he told the heartbroken South African players in the dressing room. ''We believe we have a case and we will carry this fight all the way.''

---

Follow Gerald Imray at http://twitter.com/GeraldImrayAP