A man accused of stabbing his girlfriend's sleeping son 18 times has told Merthyr Crown Court he has no memory of what happened.
Andrew Burvill, 35, of Brecon, Powys, was found covered in blood by his mother after the attack in March.
Robert Jones, 46, who has schizophrenia, claimed voices told him to "kill him".
The defendant, who denies attempted murder, said he was sorry and thought of Mr Burvill as his own son.
Giving evidence in his defence, he told the jury: "I have no memory of stabbing Andrew, but I get flashbacks of it.
"I blanked out. The next thing I remember is driving away in Andrew's van."
The court heard Mr Jones was diagnosed with paranoid schizophrenia after years of drug abuse.
He spent several years at the Caswell Clinic in Bridgend but was released back into the community where he started a relationship with Mr Burvill's mother.
He would spend five nights a week at her home in Penydarren, Merthyr Tydfil, and formed a good relationship with her son.
The court heard that the defendant stopped taking anti-psychotic drugs because they were "sedating" him.
He started having injections once a fortnight at the Royal Glamorgan Hospital but said the medication did not work.
Mr Jones told the court: "I felt psychotic and angry. I could not control my thoughts, I was delusional.
"I was off my face, I thought drugs were being put in my food and coffee.
"I've had voices since I was a teenager - they were saying to kill him.
"As I was doing it, I realised what I was doing was wrong, but I just could not stop myself."
Prosecutor Patrick Harrington asked Mr Jones: "How can you remember that if you can't remember anything else?"
"I can't remember," he replied.
Mr Jones, of Merthyr Tydfil, denies attempted murder but has admitted causing grievous bodily harm.
The trial continues.