Two New Zealand rapists have won a major victory after the United Nations ruled the rights of long-term prisoners have been breached.
The finding could lead to their release back into the community.
Michael John Carroll and Allan Miller are both currently serving preventative detention sentences for rape.
Miller was sentenced to preventive detention in 1991 on the grounds he poses a threat to the safety of the public. His parole was repeatedly denied.
Carroll was sentenced to preventive detention in 1988. He was released to a treatment centre in 2003, but was recalled after violating his parole by leaving and drinking alcohol.
Human rights lawyer Tony Ellis took their cases to the UN, arguing their detention was arbitrary and they hadn't been given enough rehabilitation.
The United Nations Human Rights Committee found Carroll's recall was "grossly disproportionate" and his rights under the International Covenant on Civil and Political Rights have been breached.
The UN also found Miller had repeatedly sought treatment focused on violence for his "sexual and aggressive feelings towards women" but hadn't been given enough opportunities.
"The State party violated the authors' rights under articles 9 (4) and 10 (3) of the Covenant by failing to provide them with timely rape-oriented rehabilitation treatment before they first appeared before the Board," the Committee found.
"This policy diminishes their likelihood of success at their first parole hearing. The Department of Corrections has failed to allocate adequate resources to the treatment of adult sex offenders."
Mr Ellis says the finding could have major implications for 850 prisoners serving indeterminate sentences such as preventive detention, or life sentences for murder. He says it will require "major legislative change".
New Zealand now has 180 days to give the UN information about the measures it will take to comply with the finding.