Paranoia, worsened by cannabis use, led a teenager to stab his friends to death, a court has heard.
Steven Bayliss and Nuttawut Meechao died in 2005
Thomas Palmer was 18 when Steven Bayliss, 16, and Nuttawut Meechao, 14, were killed in Finchampstead, Berkshire, in September 2005.
A consultant psychiatrist told Reading Crown Court how Mr Palmer had been increasingly agitated in the months leading up to the boys' deaths.
Mr Palmer, from Blagrove Drive, Wokingham, denies two counts of murder.
The jury has been told they must decide if Mr Palmer suffered from "such severe abnormality of mind" that he cannot be held responsible for his action.
The court had previously heard how the teenager slit the throat of Steven and stabbed Nuttawut Meechao (known as T.Wood Nadauld).
Dr Robert Ferris, who treated him since his arrest, told the court Mr Palmer had been suffering from hallucinations.
The consultant psychiatrist said: "I believe that his state of mind at the time of the killing was not normal.
"This was exacerbated, but not caused, by cannabis."
He told the jury how the teenager had told police that on the day of the attack - Mr Palmer had "felt uneasy, anxious and paranoid".
"He was trying to relax but there was an encounter with people who had previously caused the group some trouble," he said.
Dr Ferris said the teenager told doctors he was trying to catch his breath when his two friends had tried to reassure him by laying a hand on his back.
"At that point, a tremendous feeling of fear and an idea that they were against him took hold of his mind," he said.
"He felt a tremendous feeling of rage welling up inside him. The feelings of anxiety that had developed over many months welled up and he attacked them."
He added Mr Palmer had reported symptoms that were not just from drug use but accompany the development of schizophrenia.
The court was told Mr Palmer's father has worked at Broadmoor Hospital for the last three years, as a psychiatric nurse, but the teenager had not been examined for mental health problems.
Prosecutor Julian Boughon asked Dr Ferris: "Wouldn't you expect him to show some signs of mental illness, some abnormality?"
Dr Ferris answered: "Not necessarily."
The trial continues.