A man was stabbed 15 times by a "psychotic" neighbour as he waved goodbye to family visitors from his front door.
Paranoid schizophrenic Dean Marshall plunged a knife into Terence Robinson, 59, after warning: "Right, now I'm going to kill you."
Mr Robinson suffered stab wounds to his head, neck and body during the "ferocious and sustained" violence, which only came to a stop when brave neighbours stepped in and struggled with the knifeman, who they hit with a frying pan and restrained.
Marshall, of River Drive, South Shields, admitted causing grievous bodily harm with intent. Judge Paul Sloan QC ordered that he be detained in hospital indefinitely.
The judge said: "I make it clear, this was a very serious offence.
"But for the courageous intervention of members of the public, there is every likelihood Mr Robinson would have been killed.
"There should be no question of you being set at large unless and until the responsible authorities are completely satisfied that you no longer present a risk to the public."
The judge added that Marshall must stay away from his victim for the rest of his life and imposed an indefinite restraining order.
Jolyon Perks, prosecuting, told the court Mr Robinson had just said goodbye to his niece and her three children, who he had taken to the seaside for the day, when he was attacked outside of his flat, which was two floors down from Marshall's. After making the chilling claim about killing his neighbour, Marshall knocked him to the ground with blows to the stomach.
Mr Perks said: "He straddled Mr Robinson as he lay on the ground. He continued his attack with repeated, downward blows of the knife.
"Mr Robinson tried to roll away from underneath him and was lying on his stomach. He was then repeatedly stabbed to the head and neck by the defendant."
The court heard after inflicting one deep blow to the neck, Marshall told Mr Robinson, "this one will get you".
Mr Perks said one witness described Marshall as having a "crazed look in his eyes" as he inflicted the injuries. The court heard the horrific violence was witnessed by Mr Robinson's niece as well as neighbours. One householder armed himself with a frying pan in a bid to save Mr Robinson from the horrific attack.
Mr Perks continued: "He bravely fought with him to try and remove the knife from his grasp.
"Other witnesses said in the course of his efforts to try and stop the attack, he put himself in danger. Indeed, the defendant was unwilling to give up the knife and tried to turn the knife on him."
The court was also told that a second male neighbour stepped in and joined the struggle, and the two men kept Marshall at the scene until the police arrived. Two women had tried to distract Marshall, and managed to kick away the knife once it was eventually dropped.
Mr Robinson, who had three rib fractures as well as the 15 stab wounds, was taken to the RVI in Newcastle and needed treatment in the ambulance on the way.
He said in a victim impact statement he relives what happened to him every single day, cannot sleep at night and has been diagnosed with post traumatic stress disorder.
He has also been left with permanent scars and has lost so much grip in his hands he can no longer use a tin opener.
Mr Robinson added: "During the attack I didn't feel the first couple of knife wounds but when I saw the amount of blood I knew I was in trouble.
"When the knife went in my neck, I knew I had had it, I knew he was going to kill me. I couldnt breathe, there was so much blood inside my mouth.
"When the police came I could see them putting tape around me and I knew I was in a crime scene, I honestly thought I was dead.
"I know he will be released eventually and this terrifies me."
Mr Perks said prosecutors accept Marshall was suffering from a psychotic illness when the carried out the violence.
The judge also commended the four neighbours who stepped in to save Mr Robinson from further violence.
He added:: "But for their intervention, the charge could well have been a very much more serious one."
Jason Pitter QC, mitigating, said medical professionals in this "unusual case" agree Marshall's actions were borne out of his mental illness, which is a form of paranoid schizophrenia.