A rare sitting of the Court of Appeal has been hearing arguments that public protection orders breach human rights.
The full bench of five judges has been considering the appeal of rapist Mark Chisnall, who is one of a handful of offenders subject to an order to stay locked up after their release date.
Chisnall was meant to be released about four years ago after more than a decade behind bars, however, he has been held at a self-care unit on the grounds of Christchurch Men's Prison.
Corrections had won an interim order to monitor him indefinitely because of his risk to the public of reoffending.
He was convicted of raping and sexually abusing two children; he also violently raped a woman.
Chisnall's lawyer Tony Ellis told the Court of Appeal there are three people held at the unit because of protection orders - which are targeted at the country's worst offenders.
He denied his client comes under that banner.
The unit in question - Matawhāiti - opened in 2017 for offenders with public protection orders.
Corrections described it as a place of "civil detention".
Psychologists and the courts diagnose these men as being at very high and imminent risk to the public of causing violence or sexual harm.
The unit has come under fire from the Chief Ombudsman after an unannounced inspection in February last year.
Peter Boshier found the unit should urgently introduce more rehabilitation opportunities to avoid the risk of breaching international human rights obligations.
Tony Ellis argued in court yesterday that Chisnall gets minimal rehab - and holding him under the protection order breaches the Bill of Rights Act.
Meanwhile, another lawyer Ben Keith, told the court Chisnall is effectively being detained in a system that puts public safety first and not properly treats or assists his mental wellbeing.
In response, the Crown lawyer Daniel Perkins has been defending the legitimacy of the orders.
Perkins said risk of reoffending was central to that decision making.
"When it comes to an application for an extended supervision order or a public protection order - the court is asked to assess future risk - issues like high risk or very high risk," he said.
Perkins acknowledged Corrections had a responsibility to care and rehabilitate.
"The courts will no doubt hold the Department of Corrections accountable for delivering a standard of rehabilitative treatment which is directed towards making Mr Chisnall and others... placing them in the best position possible for reducing their risk so they no longer need to be in the restrictive environment," he said.
He told the court the vast majority of sex offenders were released and don't get protection orders.
The case before the five Court of Appeal judges continues today.