CNN  — 

Two-time Olympic champion Caster Semenya has lost an appeal against the restriction of testosterone in female athletes, it was announced Tuesday.

Under World Athletics guidelines introduced last year, Semenya would have to take testosterone-reducing drugs in order to compete in races from 400m to a mile, which the 29-year-old has chosen not to do.

Switzerland’s Federal Supreme Court dismissed Semenya’s appeal, upholding the ruling made by the Court of Arbitration for Sport (CAS) last year regarding female runners, like Semenya, with differences of sexual development (DSD).

“Chills my people, a man can change the rules but the very same man cannot rule my life,” Semenya wrote on Twitter after the ruling was announced.

Visit CNN.com/sport for more news, videos and features

Semenya competes in the women's 200m final during the Athletics Gauteng North Championships in Pretoria in March.

“What I’m saying is that I might have failed against them (but) the truth is that I have won this battle long ago.

“Go back to my achievements then you will understand. Doors might be closed (but) not locked.”

Semenya, who won 800m gold at the 2012 and 2016 Olympics, in March said she would target the 200m, an event she is permitted to compete in without taking medication to reduce her naturally elevated testosterone levels.

She was competing in the 200m in her native South Africa earlier this year with an eye on qualifying for the Olympics before the postponement of this year’s Games was announced.

“I am very disappointed by this ruling, but refuse to let World Athletics drug me or stop me from being who I am,” Semenya said in a statement released via her lawyers, according to PA Media.

“Excluding female athletes or endangering our health solely because of our natural abilities puts World Athletics on the wrong side of history.

“I will continue to fight for the human rights of female athletes, both on the track and off the track, until we can all run free the way we were born. I know what is right and will do all I can to protect basic human rights, for young girls everywhere.”

World Athletics welcomed the decision by the Swiss courts to uphold what it deems “a legitimate and proportionate means of protecting the right of all female athletes to participate in our sport on fair and meaningful terms.”

A statement from the governing body said: “World Athletics fully respects each individual’s personal dignity and supports the social movement to have people accepted in society based on their chosen legal sex and/or gender identity.

“As the Swiss Federal Tribunal (SFT) specifically recognized, however, the DSD regulations are not about challenging an individual’s gender identity, but rather about protecting fair competition for all female athletes.”