Olympic track champion Caster Semenya must take drugs to suppress her testosterone levels to compete again in certain women's races, the highest court in international sports ruled.

The landmark ruling by the Court of Arbitration for Sport in Switzerland is expected to have widespread implications for transgender and intersex athletes throughout sport — and is getting slammed by some supporters of Semenya as sexist and racist.

Semenya, a mid-distance meter track star from South Africa, who won the gold in the 800-meter races at the 2012 and 2016 Olympics, has had her gender and hormone levels highly scrutinized over the years.

Wednesday's decision by the court in Switzerland upheld the International Association of Athletics Federations' standards that dictate and regulate who can compete in women's sports.

The IAAF says athletes with "differences of sex development" have more oxygen-carrying capacity and muscle mass that gives them an "unfair" advantage in some women's sports events, and therefore female competitors with high levels of testosterone should have to take medicine that reduce the levels.

The IAAF in a split 2-1 decision said the rules are "a justified and proportionate means of ensuring consistent treatment, and preserving fair and meaningful competition" among women, according to a release from the arbitration court Wednesday.

Semenya and the South Africa sports organization Athletics South Africa, which backs her, appealed the rules, calling them “discriminatory, unnecessary, unreliable and disproportionate.”

But she lost the appeal as the sports high court's panel determined that elevated testosterone in females gives women a competitive advantage in certain races shorter than one mile, such as the 400-meter and the 800-meter races in which Semenya competes.

Matthieu Reeb, General Secretary of the Court of Arbitration for Sport, speaks to the media in Lausanne, Switzerland, on May 1, 2019. Laurent Gillieron / Keystone via AP

“Regulations are discriminatory but the majority of the Panel found that, on the basis of the evidence submitted by the parties, such discrimination is necessary, reasonable and proportionate,” the court ruled.

Now, if Semenya wants to compete in the races that vaulted her to becoming a world champion, she will have to either medicate long-term to reduce her testosterone levels or compete alongside men.

In response to the decision, Semenya tweeted a photo with the words, “Sometimes it’s better to react with no reaction.”

Some supporters of Semenya say the IAAF’s rules target her personally — as they don’t apply to races in which she doesn't compete — and because she is black. They also question why there aren’t similar rules for men.

"It’s really important to note that this was a split decision," said Katrina Karkazis, a bioethicist and senior fellow at the Global Health Justice Partnership at Yale University. "It is not the case that everyone felt that discrimination against women was warranted in order to have a so-called 'level playing field.'"

"This ruling will simply bolster the erroneous idea that testosterone is jet fuel for athletes," she added. "My own work has led me to know there is not scientific evidence to support such a regulation."

In a tweet, the Women’s March called the ruling “racist, sexist, and transphobic.”

In the ruling, the high court on sport arbitration did point out concerns over the IAAF’s rules, citing difficulties with implementation, questions about the reliability of hormonal difference evidence, and concerns about the possible side effects of hormonal treatment on athletes.