Thon Lam was found not guilty of the murder of Davina Nguyen on the grounds of insanity.

An Auckland man who stabbed a woman to death during a psychotic episode has been declared insane.

Thon Lam, 38, was in the grips of psychosis having stopped taking medication when he killed Davina Jane Nguyen on April 19, 2015, at home in Papatoetoe.

In a judgment released on Friday, Justice Simon Moore explained that Lam had been found not guilty of murder on the grounds of insanity.

His trial - set down for April - had been vacated and Lam would now be treated as a "special patient" and indefinitely detained in care.

READ MORE: * Man accused of murder loses name suppression

"There is ample evidence on which I can be satisfied, on the balance of probabilities, that Mr Lam was insane at the time he killed Ms Nguyen," Justice Moore said in his judgment.

"His schizophrenia was such that he did not know that what he was doing was morally wrong."

On April 19, 2015, Lam stabbed Nguyen to death with a knife, in the kitchen of the property where they both lived.

His offending came a couple of months after he had switched his anti-psychotic medication from injection to taking pills. He then stopped taking his pills.

At the time of the killing, Lam was having hallucinations and hearing voices - he believed Nguyen and others at the house were plotting to kill him.

Justice Moore said Lam was diagnosed with schizophrenia in 1997 and had "approximately nine psychiatric hospital admissions".

An "ethnic Chinese man from Cambodia", Lam was three when in 1979 his family fled the Khmer Rouge to Vietnam, where he lived in a refugee camp until he was 15.

"In the course of their flight his father and older sister died from infectious illnesses," Justice Moore said.

At the camp, Lam was "exposed to various life-changing experiences including witnessing his close friend being fatally stabbed in front of him ... [and] it was within a very short time of this Mr Lam developed his first psychotic episode manifested by suspicion and fear of being killed".

In February 2015, Lam's mental health worker reported that he was doing well, but he subsequently missed two appointments.

In the days before the stabbing, his co-workers at his printing job reported that he was acting unusually and then failed to attend work.

He had been absent from his home for a couple of days, at which point Nguyen - worried about him - asked him to come home.

Once there she asked him to rest, as he had not been sleeping. She took his phone and keys and told him she would take him to hospital in the morning.

Nguyen and others living at the address "were deeply worried about him", Justice Moore said.

Two expert psychiatrists who reviewed the case agreed that Lam was in the midst of a psychotic episode at the time he stabbed Nguyen.

According to one, he "had been suffering from paranoid thinking, auditory hallucinations and disorganised behaviour".

Justice Moore explained that when Lam arrived home "[he] believed he heard the deceased and another friend discuss how they might kill him and chop off his head".

"Upon the removal of his keys and cell phone, Mr Lam 'suddenly believed that he was likely to be killed imminently'," Justice Moore summarised.

"He then heard the voice he had been experiencing in the weeks leading up to the offending, saying to him, 'just do it or she will get them to kill you anyway'.

"Mr Lam then stabbed the deceased as she advanced towards him asking him to hand over the knife."

Justice Moore accepted the psychiatrists' opinions that Lam be detained as a special patient.

"Special patients are detained indefinitely in a secure mental health facility until such time as the Minister of Health, following consideration of reports from medical professionals, is satisfied that continued detention is no longer necessary to ensure the safety of the public," he said.

Sign up to receive our new evening newsletter Two Minutes of Stuff - the news, but different