A psychiatric patient who killed a fellow patient with an electric guitar inside a NSW mental health ward has been found not guilty of murder due to mental illness.

Key points: Paul Gumley struck, strangled with own guitar by hospital roommate Paul Hindmarsh

Paul Gumley struck, strangled with own guitar by hospital roommate Paul Hindmarsh Hindmarsh did not know what he was doing due to mental illness, judge said

Hindmarsh did not know what he was doing due to mental illness, judge said Hindmarsh will be detained until Mental Health Review Tribunal considers a release to be safe

Paul Hindmarsh used Joseph Gumley's electric guitar to strike the 47-year-old over the head, in the room they shared at Shellharbour Hospital in July 2014.

He also used the guitar's cord to strangle Mr Gumley.

The NSW Supreme Court heard Hindmarsh later told a psychiatrist, he was unable to sleep at the time and heard voices saying, "kill, kill, kill".

Hindmarsh said he thought he was "Jack" in the movie The Shining, referring to the horror film's lead character Jack Torrance played by Jack Nicholson.

"I picked up his electric guitar... and I just hit him," he told the psychiatrist.

After attempting to strangle Mr Gumley with the guitar lead, Hindmarsh struck him over the head two or three more times, because "he was still breathing".

Hindmarsh to be detained until he is considered safe to release

Justice Stephen Campbell said because of his severe paranoid schizophrenia, Hindmarsh did not know what he was doing was wrong.

Paul Hindmarsh will be detained until the Mental Health Tribunal considers a release to be safe. ( Photo: ABC News )

Paul Hindmarsh had been an involuntary patient on the ward for almost a year prior to the attack.

He had refused to take oral medication and was receiving fortnightly injections.

Psychiatrists retained by the crown and defence both concluded the mental health defence was available to Hindmarsh.

Justice Campbell returned a special verdict of not guilty due to mental illness.

He said that did not mean Hindmarsh could walk free from court.

"There is not the slightest question of it being appropriate to release him at this time," Justice Campbell said.

He ordered that Hindmarsh be detained by the Mental Health Review Tribunal.

It means Hindmarsh will be detained at a correctional or other facility until the tribunal considers it safe to release him.

Months after the incident, a NSW Health investigation revealed the pair had not been checked on for hours.