Caster Semenya has lost her landmark legal case against athletics’ governing body, the IAAF, which means she will have to take medication to reduce her testosterone if she wants to keep running on the international stage.

The surprise decision, which was announced by the Court of Arbitration for Sport after three judges had spent more than two months deliberating over the complex and highly contentious case, came even though Cas agreed that the IAAF’s policy was discriminatory to athletes with differences in sexual development (DSDs) such as Semenya. In a statement Cas said Semenya’s team had been unable to prove the IAAF’s policy was “invalid”. Instead it ruled that its policy was in fact “necessary, reasonable and proportionate” to ensure fair competition for females.

It added: “The panel found that the DSD Regulations are discriminatory but that, on the basis of the evidence submitted by the parties, such discrimination is a necessary, reasonable and proportionate means of achieving the IAAF’s aim of preserving the integrity of female athletics in the Restricted Events.”