A paranoid schizophrenic stabbed his young brother to death just hours after community mental health workers left his house saying there was no immediate problem, a court has heard.
Daniel Taylor, 21, attacked nine-year-old Jack at their sister's house in Bradford, West Yorkshire, in February last year, leaving him with horrific injuries.
Today, a judge ordered Taylor to be detained indefinitely at the top-security Rampton Special Hospital in Nottinghamshire.
Taylor admitted manslaughter due to diminished responsibility at an earlier hearing.
He sat in the dock today surrounded by guards and carers and showed no emotion as the court was told about the attack on his brother and his history of mental health problems.
The court was told he had doted on Jack when he was born, they were close and he loved him very much.
But Simon Bourne-Arton QC, prosecuting, said Taylor had been diagnosed with paranoid schizophrenia a number of years earlier and also had problems with cannabis use and alcohol.
From May to August 2009 he was admitted to Lynfield Mount Hospital in Bradford and, when he was released, he was monitored by a community mental health team.
But, the court heard, he would often fail to take his medication and eventually his condition began to deteriorate.
Mr Bourne-Arton said he was hearing voices and became more threatening to his family.
The day before the attack his family tried to contact the mental health team as his mother became more and more concerned about his behaviour.
His mother said Taylor was due a benefits payment which she feared he would spend entirely on cannabis, the judge heard.
She then found he had burned a picture of himself and was "out of his head".
Mr Bourne-Arton said Taylor's key care worker was away and on February 18, the day of the attack, his team had training which meant the message was not picked up until the afternoon.
Members of the team did visit Taylor at home later in the day.
The prosecutor said they stayed for about 20 minutes and left after concluding "there was no immediate problem or crisis".
Five hours later, he said, Taylor picked up a 8.7in (22cm) kitchen knife and went looking for his brother, Mr Bourne-Arton said.