Oscar Pistorius, who is accused of murdering his girlfriend Reeva Steenkamp, has been granted bail after a four-day hearing.
Magistrate Desmond Nair said that the defence had failed to successfully argue exceptional circumstances or expose a weakness in the case of the prosecution.
However, Nair was satisfied that Pistorius, who had offered to hand in his passport, was not a flight risk or a danger to others.
He also said that the prosecution could not prove that their case was "watertight".
Nair's decision to release Pistorius was greeted by a shout of "yes" from the Paralympian's brother, Carl.
Pistorius denies murder, claiming that he shot Steenkamp thinking she was an intruder at his home.
The next hearing in the case has been set for June 4.
Bail has been set at 1,000,000 Rand (£74,000) and conditions include a ban on leaving Pretoria.