A man stabbed his girlfriend's sleeping son 18 times because voices in his head told him to do it, a court heard.
Andrew Burvill, 35, of Brecon, Powys, was found covered in blood by his mother after the attack in March.
Merthyr Crown Court heard Robert Jones, 46, who has schizophrenia, claimed voices told him to "kill him".
Mr Jones, of Merthyr Tydfil, denies attempted murder but admitted causing grievous bodily harm.
The court heard Mr Jones loved Mr Burvill "like a son" and the pair were close friends and drinking partners.
But he began behaving oddly in the weeks before the attack and was convinced people were trying to poison him.
Patrick Harrington, prosecuting, said: "Jones took a kitchen knife and went to a bedroom where Mr Burvill was sleeping.
"For a moment he thought Jones was messing around - he wasn't."
Mr Burvill was stabbed in the head, neck chest and left leg and jurors heard Jones' face was "expressionless and blank" during the attack.
His mother Gaynor Burvill said he looked like something from a "horror show" and begged neighbours to help him.
They helped stem the flow of blood with towels and the court heard he would have died if it had not been for the prompt actions of paramedics and hospital staff.
Mr Burvill spent 10 weeks in hospital and still suffers from flashbacks and nightmares.
He told the court: "He just kept on stabbing and stabbing, he was like a maniac trying to kill me."
"It was a shock, there were no motives, there was no reason," he added.
The court heard Ms Burvill and her son knew about Mr Jones' mental illness and he had recently been admitted to hospital for treatment.
After his arrest Mr Jones told police: "I hear voices and I follow them. I'm schizo, it's my illness.
"I heard voices for 10 minutes before getting the knife from the kitchen. The voices said 'kill him'."
Mr Jones' defence team claims he lacked intent to commit attempted murder because of his illness.
The trial continues.