Oscar Pistorius must have his trial adjourned while he undergoes psychiatric assessment, the judge has ruled.
Judge Thokozile Masipa has ruled that the Paralympian should be referred to a mental health hospital for 30 days to assess whether he is suffering from Generalised Anxiety Disorder (GAD), which makes people unduly fearful.
She said the aim of the referral was "not to punish the accused" and added favoured the possibility of out-patient treatment.
Pistorius denies the murder of his girlfriend Reeva Steenkamp, who he shot on Valentine's Day last year, claiming he thought she was an intruder. The prosecution alleges that he shot the model and reality TV star deliberately.
The referral application came from prosecutor Gerrie Nel, who said: "If there is a reasonable possibility that some mental illness or disorder played a part, the court must refer."
Dr Merryll Vorster, the defence's psychiatrist, said on Tuesday she had diagnosed him with GAD, adding he had been suffering from it since he was a baby, when he had both legs amputated, which someone so young would have perceived to be a "traumatic assault".
She added: "There is no doubt that children who have bilateral amputations at the age of 11 months find that very stressful … It's a factor that contributed to the development of GAD."
Dr Vorster said the condition could leave him "hypervigilant" and said it would have been worsened by the fact he grew up with an absent father and the death of his mother when he was 14.
Pistorius' mother used to sleep with a firearm beneath her pillow and had an irrational fear of intruders, the court heard on Tuesday.
The trial also heard how, growing up, Pistorius slept with the door locked and was anxious about the safety of his siblings when he travelled.
Nel has challenged a psychiatrist's assessment that Pistorius suffered from anxiety, pointing out his lack of concern over a broken window which had left unattended for a few days.
Pistorius' lawyer Barry Roux opposed the application to refer his client, saying it was "premature".
Previously, the court heard Pistorius was "heartbroken" in the days after Steenkamp's death.
Social worker and probation officer Yvette van Schalkwyk told the court: "He was sorry for his loss, he was sorry for her parents."