Convinced he was doing God's work, Zarn Tarapata frantically stabbed two men to death in an Takanini pawn shop's lunch room before consulting his Bible.
After two trials and a verdict of not guilty of murder by way of insanity, the 27-year-old Auckland man was on Friday, in the High Court at Auckland, declared a special patient to be held at a secure mental health facility until deemed safe.
It ends more than three years of reports and legal battles over whether Tarapata was legally insane when he killed Takanini Ezy Cash owner Paul Fanning, 69, and employee Paul Matthews, 47, as they ate noodles in the back of the shop on July 19, 2014.
Many of the facts were not in dispute.
A delusional Tarapata incorrectly thought his long-term partner - who also worked at the store - was having some sort of affair with the men.
As she popped into the shop on a Saturday afternoon to help a customer, he crept inside - armed with a knife - and had two minutes later stabbed Mr Matthews and Mr Fanning 21 times in an unprovoked attack.
A jury two years ago found Tarapata guilty and he was sentenced to life in jail.
But at that trial, prosecutors argued his insanity had been caused by methamphetamine use - something questioned by the Court of Appeal when it overturned the convictions as a a miscarriage of justice, saying the defence had mishandled the drug issue and the Crown had used inadmissible evidence to press the point.
Granted a second trial, prosecutors accepted Tarapata suffered from schizophrenia, the details of the first case kept out of evidence to ensure he received a fair trial.
Instead, it was his motives they questioned.
Prosecutor Richard Marchant argued that while Tarapata had been delusional, he was still capable of knowing the deaths were morally wrong.
"He was jealous and he was angry," he told the jury.
Tarapata's former partner, Tamara Cassie, gave evidence the defendant took a Bible with him everywhere, claimed God spoke to him and had made "sacrifices" of meat in burning rituals in the months before the attack.
He had also been growing increasingly paranoid, arming himself with knives and staying up all night to protect their children.
Tarapata himself told psychiatrists God had told him to kill the men - even saying he had tried to haggle the divine power down to just a beating.
But Mr Marchant questioned why Tarapata's claims of heavenly instruction only came eight months after the fact and suggested he and Ms Cassie had become confused in hindsight.
For its part, the defence called two psychiatrists who said they were convinced Tarapata did not understand his actions.
Given the lack of serious violence in his past, and little evidence he had temper or jealously issues, there was no other way to explain the defendant's actions, lawyer Jonathan Krebs argued.
"[Insanity] is not a defence in a sense that is some sort of legal construct that permits the guilty to go free," he quoted.
"It is a recognition by the law that a person may ... be so disordered in their thinking, that at the time they lack the capacity to be held responsible."
Tarapata will now be held at Auckland's Mason Clinic indefinitely, until discharged by the Minister of Health.