Athletics' world governing body, the IAAF, announced Thursday a separate classification for athletes of Difference of Sexual Development (DSD) which will require those athletes to reduce their blood testosterone levels -- and maintain those levels -- if they want to compete internationally.
Semenya, who carried the flag for South Africa at the Commonwealth Games opening ceremony, is hyperandrogenous -- meaning she has elevated testosterone levels -- and the condition has dogged her athletics career ever since she won the world 800m title as an 18-year-old in 2009.
Earlier Thursday, double Olympic 800m champion Semenya tweeted: "I'm 97% sure you don't like me, but I'm 100% sure I don't care."
The new regulations, unanimously agreed by the IAAF, will cover events from 400m to the mile and come into effect from November 1, 2018.
DSD athletes will have to reduce their blood testosterone level to below 5nmol/L for a continuous period of at least six months and must maintain those levels continuously for the rest of their athletic career.
Female athletes who want to take part in international events but do not lower their testosterone levels will be allowed to compete against men.
In a statement, IAAF President Sebastian Coe said that the federation had a "responsibility to ensure a level playing field."
"The revised rules are not about cheating, no athlete with a DSD has cheated, they are about leveling the playing field to ensure fair and meaningful competition in the sport of athletics where success is determined by talent, dedication and hard work rather than other contributing factors," the Englishman added.
'No athlete will be forced to undergo surgery'
The IAAF said: "There is a broad medical and scientific consensus, supported by peer-reviewed data and evidence from the field, that the high levels of endogenous testosterone circulating in athletes with certain DSDs can significantly enhance their sporting performance.
"These Regulations accordingly permit such athletes to compete in the female classification in the events that currently appear to be most clearly affected only if they meet the Eligibility Conditions defined by these regulations."
The governing body continued: "Most females (including elite female athletes) have low levels of testosterone circulating naturally in their bodies (0.12 to 1.79 nmol/L in blood); while after puberty the normal male range is much higher (7.7 -- 29.4 nmol/L).
"No female would have serum levels of natural testosterone at 5 nmol/L or above unless they have DSD or a tumour. Individuals with DSDs can have very high levels of natural testosterone, extending into and even beyond the normal male range."
Dr Stephane Bermon, from the IAAF Medical and Science Department, said in a statement: "The latest research we have undertaken, and data we have compiled, show that there is a performance advantage in female athletes with DSD over the track distances covered by this rule."
Dr Bermon added that the treatment to reduce testosterone levels was a hormone supplement similar to the contraceptive pill.
No athlete, Dr Bermon said, would be forced to undergo surgery, adding that it would be the "athlete's responsibility to decide on her treatment."
A career in the spotlight
Semenya emerged onto the world stage as an 18-year-old at the 2009 World Championships, winning the 800m in 1:55:45, but was forced to undergo gender tests. In 2010 she was cleared by the IAAF to compete after 11 months out of the sport.
In 2011, the governing body introduced a testosterone limit but in July 2015 Indian sprinter Dutee Chand won a landmark case which allowed inter-sex athletes to run without testosterone-suppressing medication and the Court of Arbitration for Sport (CAS) suspended the IAAF's rules for two years. That suspension was extended for a further six months in 2017.
Semenya had her London 2012 800m silver upgraded to gold after Russia's Mariya Savinova was stripped of the title for doping.
The South African went on to defend her title at Rio 2016 and a year later won 800m gold at the World Championships in London with a personal best 1:55.16 -- the 15th fastest time in history.
More recently, Semenya completed a 800m and 1500m double at this month's Commonwealth Games, but the athlete has never come close to the 800m world record which has stood for 34 years.
"It's not about looking at people [and] how they look, how they speak, how they run," Semenya told the Sydney Morning Herald earlier this month.
"You know, it's not about being muscular. It's about sports," she said. "When you walk out of your apartment, you think about performing. You don't think about how your opponents look. You just want to do better."