After days of treatment, David Charles Edgerley says he was released from a mental health facility despite believing he was Jesus and the King of England.
A month later Edgerley set his Brisbane housemate Victor Graveson's bedroom alight as the 65-year-old slept after hearing voices in the TV, radio and his head.
Mr Graveson died three days later in September 2017 after suffering burns to 80 per cent of his body.
Edgerley, 39, told the Supreme Court that he checked into Logan hospital's mental health centre because he was "losing myself".
"I had these beliefs that I was Jesus and I was here to heal the world and I was King of England," he told the jury.
"I recognised that I probably needed to get looked at.
"They (Logan hospital) assessed me."
However, Edgerley claimed staff released him after four days because they thought he was no threat or danger to the public, despite his "very odd" beliefs.
"Maybe they should have held me a little longer to properly diagnose me but it didn't happen," he said.
He resumed taking drugs days after his release.
Edgerley agreed that drugs "didn't help" his psychotic symptoms and made his belief that he was Jesus "more real".
His mental health worsened after he began staying at "underworld figure" Mr Graveson's Alexandra Hills home in September 2017, the court heard.
Edgerley was using drugs daily and he had stopped taking his medication.
He believed Mr Graveson was "going to get him" after he witnessed the 65-year-old assault a woman but later told police that her wounds were self-inflicted.
"I was his alibi. He (Mr Graveson) didn't want me going away," Edgerley said.
"I was told (by Mr Graveson) to stay at the house ... or the 'men in black' would come get me - I wanted to get away as quickly as possible."
Edgerley said he decided to set Mr Graveson's bedroom alight to create a diversion for his escape after hearing voices in the TV and radio telling him to "burn it".
He claimed he could also hear his niece calling for help and his mother saying "good boy" in his head at the time.
"I threw the petrol in the room to get away, not harm or hurt. I was just acting on the voices," he said.
Edgerley said he stopped to try and lock a door to give him more time to get away when he saw Mr Graveson emerge from his bedroom.
"He came running out, he was yelling. He seemed fine ... he wasn't on fire - I thought he was coming after me," he said.
Edgerley rejected the crown prosecutor's suggestion that he was leaning on the door to keep it closed and ensure Mr Graveson could not escape and only left after being struck by a witness.
"I turned and ran. He was a very powerful, dangerous person. I was scared for my life," he said.
Edgerley confirmed that he later told lies to Redland hospital staff and his grandmother about how the fire started.
"I wasn't talking any sense. I was lost. I was gone," he said.
"I wanted to ring my grandmother who I thought was the Queen of England.
"I thought my niece had been raped ... I thought he (Mr Graveson) was coming to get me - I was a wreck."
Edgerley has pleaded not guilty to murder.
His trial before Justice Soraya Ryan continues.