Caster Semenya has lost her appeal to Switzerland's Federal Supreme Court against the restriction of testosterone levels in female runners.
Semenya is not allowed to compete in events between 400m and a mile without taking testosterone-reducing drugs, following a 2019 rule change by governing body World Athletics.
"I am very disappointed," the 29-year-old South African said.
"I refuse to let World Athletics drug me or stop me from being who I am."
Athletics' governing body brought in a rule that athletes with differences of sexual development (DSD) must either take medication in order to compete in track events from 400m to the mile, or change to another distance.
Athletes with DSD have higher levels of natural testosterone, which World Athletics believes gives them a competitive advantage.
"Excluding female athletes or endangering our health solely because of our natural abilities puts World Athletics on the wrong side of history," Semenya added.
"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."
The Court of Arbitration for Sport rejected a Semenya challenge against the rule last year.
The Swiss Supreme Court then temporarily suspended the ruling, before later reversing its decision.
It meant Semenya, who won Olympic gold in the 800m in both 2012 and 2016, missed the chance to defend her world 800m title in Doha last year, having failed in her bid to prevent the governing body's rule change.
Semenya is now "considering all of her options, internationally and domestically".
In a statement, World Athletics said: "For the last five years World Athletics has fought for and defended equal rights and opportunities for all women and girls in our sport today and in the future.
"We therefore welcome today's decision by the Swiss Federal Tribunal to uphold our DSD regulations as a legitimate and proportionate means of protecting the right of all female athletes to participate in our sport on fair and meaningful terms."
The Swiss Supreme Court said: "Fairness in sport is a legitimate concern and forms a central principle of sporting competition. It is one of the pillars on which competition is based."
The ruling means Semenya will not be able to defend her 800m title at the rearranged Tokyo Olympics next summer.
In March, she said she wants to compete in the 200m in Tokyo, a distance for which she would not need to take medication.
To be able to compete, she would have to run a qualifying time of 22.80 seconds, although her current best is 24.26secs.