A troubled teenager had warned officials "someone will get killed" before he stabbed a shopworker to death, jurors have heard.
Ethan Mountain left Joan Hoggett with 29 knife wounds when he attacked her as she stacked shelves at the One Stop Shop in Fulwell, Sunerland, last September.
The 19-year-old, of Heaton Gardens, South Shields, denies murder and is being tried by a jury at Newcastle Crown Court.
He has pleaded guilty to manslaughter on the grounds of diminished responsibility.
Consultant Forensic Psychiatrist Ramneesh Puri has told jurors about Mountain's history, which included him being diagnosed with ADHD when he was 12 and him being hospitalised and diagnosed as "acutely psychotic" between June and August 2017.
Mountain had been admitted to hospital due to his paranoid thoughts and thoughts of "harming others with an axe, hammer, knife and belt".
During his stay, Mountain described himself as a "bad person" and told staff he would "end up in Broadmoor".
Dr Puri told the court: "He said he needed to remain in hospital in order to prevent him harming anyone."
The court heard while in hospital, Mountain had confessed to "stalking people in parks" and said he "wanted to harm them but never did".
The court heard he had said he would kill himself rather than hurt anyone else and was "distressed" by his own thoughts.
Mountain had also told staff: "Everyone thinks that I am a good person, that's because of the ability to charm people and they trust me.
"You may think that's scary, someone having the thoughts I am having, to trick someone into thinking I'm a nice person when inside I want to seriously hurt them."
Mountain, who said he started taking cannabis at age 15 but cut back because he experienced "profound hallucinations" claimed to have harmed animals in the past and told medics: "Someone will get killed and then I will get arrested."
The court heard Mountain was on a "low dose" of anti-psychotic medication when he was released from the psychiatric hospital in August 2017 and started drinking vodka, heavily.
Mountain claimed he had stopped taking his prescribed medication "about a week before" he attacked Mrs Hoggett and was due to see a psychiatrist the following month.
While in prison after the killing, he was assessed as being "very psychotic".
During interview after the attack, Mountain told Dr Puri he had been hearing voices and had had an argument with his mother just before the killing.
He added: "She was concerned I was drinking too much, I was concerned that the doctors would throw me back in hospital.
"The voices were saying I would be crazy and I would be sectioned."
Mountain said he had limited recollection of the actual attack on Mrs Hoggett.
He said: "I can't remember physically doing it, I just remember walking to the shop, thinking people were talking about me and then I was coming out of the shop, covered in blood.
"I knew I had done something wrong, I went to the park and began self-harming."
The trial continues.