An Auckland man who tried to "cut off" his victim's head will now likely spend several years in a hospital after being found unfit to stand trial.
Solomona Tofilau took to his neighbour with a machete in December last year without warning or provocation.
The attack came after some apparent harboured resentment towards Michael Norris, whom he thought was a negative influence on the neighbourhood.
The 65-year-old swung the blade at Norris' head, who at the last moment raised his arm to protect himself - causing a deep wound to his left forearm, court documents read.
Norris suffered another cut to the left side of his neck before a bystander, who witnessed the assault, intervened and disarmed Tofilau before police arrived.
Tofilau later told police he intended to kill Norris by cutting his head off and said his victim was lucky to survive.
He also said he thought Norris had stolen his television
Police charged Tofilau with attempted murder. However, last month Justice Timothy Brewer found him unfit to stand trial on the evidence of two health assessors.
"It is quite clear that Mr Tofilau suffers from significant cognitive impairment. That was apparent from the police DVD interview and was confirmed by both health assessors in their first reports," the judge said in his August decision.
He added that while Tofilau understands the court process sufficiently to enter a plea and the nature, purpose and possible consequences of being convicted of attempted murder, he was unable to communicate adequately with his lawyer to conduct a defence.
"It seems Mr Tofilau suffers from a species of dementia and the latest reports of the health assessors point to the likelihood of both a disease base and a base of historical injury that might account for the observed cognitive impairment," Justice Brewer said.
"Mr Tofilau is unable to orient himself in time and space. He cannot stick to the point. With huge difficulty he can be brought to a point, but his answers are variable."
Both defence counsel and the Crown prosecutor accepted Tofilau was unfit for trial, who today appeared in the High Court at Auckland again for a disposition hearing, where the judge decided where Tofilau would be detained.
Justice Brewer ordered Tofilau be admitted to the Mason Clinic, the forensic mental health services unit for the northern region's courts and prisons.
The court heard psychiatrist reports suggested Tofilau was "very unlikely" to improve and suffered from "grandiose, religious and paranoid" delusions.
Justice Brewer said he had "very serious concerns" for public safety if Tofilau was to be released.
He can be kept at the Mason Clinic for a maximum of seven years under the Mental Health Act, the court heard.
Under New Zealand law, a defendant is considered unfit to stand trial if they are unable to, due to mental impairment, conduct a defence or to instruct counsel to do so.
This includes a defendant who, due to mental impairment, is unable to plead, to adequately understand the nature or purpose or possible consequences of the proceedings, or to communicate adequately with counsel for the purposes of conducting a defence.