Athletics South Africa (ASA) says it is "reeling in shock" after Olympic 800m champion Caster Semenya lost a landmark case against athletics' governing body.
The South African, 28, challenged new IAAF rules which attempt to restrict testosterone levels in female runners.
Athletes with differences of sexual development (DSD) must now take medication to compete in some track events or change to another distance.
ASA said the decision "goes to lengths to justify" discrimination.
Semenya had challenged the IAAF's new rules at the Court of Arbitration for Sport (Cas) but on Wednesday it announced it had rejected the appeal.
"We believe their decision is disgraceful," ASA added.
And it said by justifying discrimination, Cas had "seen it fit to open the wounds of apartheid" - the South African political system which enforced white rule and racial segregation until 1991 - which it pointed out was "condemned by the whole world as a crime against humanity".
Cas found the rules for athletes with DSD, like Semenya, were discriminatory - but that the discrimination was "necessary, reasonable and proportionate" to protect "the integrity of female athletics".
But, in making the ruling on Wednesday, Cas said it had "serious concerns as to the future practical application" of the regulations.
Semenya, a multiple Olympic, World and Commonwealth champion, said she believed the IAAF "have always targeted me specifically".
"We are reeling in shock at how a body held in high esteem like Cas can endorse discrimination without flinching," said ASA in a statement on Wednesday.
"For Cas does not only condone discrimination but also goes to lengths to justify it, only undermines the integrity that this body is entrusted with.
"We are deeply disappointed and profoundly shocked."
Semenya is still eligible to compete at the Diamond League meet in Doha on Friday and can make an appeal against the Cas ruling to the Swiss Tribunal Courts within the next 30 days.
ASA said it was "encouraged to take the matter further" because of some of the observations raised by Cas in the ruling.
"ASA was confident of a favourable outcome given the human rights, medico-legal and scientific arguments and evidence that we believe invalidated the regulations," it added.
"It is these facts that have left ASA shocked that Cas rejected these compelling factors in favour of the IAAF.
"ASA reiterates that this may not be the end of the matter."
What are the proposed changes?
The rules, applying to women in track events from 400m up to the mile, require athletes to keep their testosterone levels below a prescribed amount "for at least six months prior to competing".
However, 100m, 200m and 100m hurdles are exempt, as are races longer than one mile and field events.
Female athletes affected must take medication for six months before they can compete, and then maintain a lower testosterone level.
The rules were intended to be brought in on 1 November 2018, but the legal challenge from Semenya and Athletics South Africa caused that to be delayed until 26 March.
The United Nations Human Rights Council has called the plans "unnecessary, harmful and humiliating" and South Africa's sports minister called them a "human rights violation".
- 31 July 2009: 18-year-old Semenya runs fastest 800m time of the year to win gold at the Africa Junior Championships.
- August 2009: Semenya undertakes a gender test before the World Championships in Berlin. She is unaware of the purpose of the test, with Athletics South Africa president Leonard Chuene telling her it is a random doping test.
- 19 August 2009: Semenya wins 800m world gold, breaking the world-leading mark she set in July. After her victory, the news of Semenya's gender test is leaked to the press.
- November 2009: There are reports that Semenya's test has revealed male and female characteristics. The results are not made public.
- 6 July 2010: Semenya is cleared by the IAAF to compete again.
- 22 August 2010: Semenya wins the 800m at an IAAF event in Berlin.
- 11 August 2012: Semenya wins 800m silver at the 2012 London Olympics. This is later upgraded to gold after Russian winner Mariya Savinov is given a lifetime ban for doping violations. Semenya is also upgraded to 2011 world gold.
- July 2014: India sprinter Dutee Chand, 18, is banned from competing after a hormone test shows natural natural levels of testosterone normally only found in men.
- 23 March 2015: Chand begins a legal challenge against the IAAF's so-called gender tests.
- 27 July 2015: Chand is cleared to compete; the Court of Arbitration for Sport suspends, for two years, the introduction of an earlier version of IAAF rules requiring female athletes to take testosterone-suppressing medication.
- 20 August 2016: Semenya wins 800m gold at the Rio Olympics, but the decision to allow her to compete is questioned by other athletes.
- 4 July 2017: Research commissioned by the IAAF finds female athletes with high testosterone levels have a "competitive advantage".
- 26 April 2018: The IAAF introduces new rules for female runners with naturally high testosterone.
- 19 June 2018: Semenya says she will challenge the "unfair" IAAF rules.
- 18 February 2019: Semenya's legal hearing begins at Cas.
- 1 May 2019: Semenya loses her challenge.