Nine prison inmates who say they have been tortured and kept in inhumane conditions have begun a case against the Corrections Department, prison bosses and the Attorney General.
The prisoners, from some of New Zealand's toughest jails, want compensation for what they call unlawful punishment.
The High Court in Wellington has been told that the system of solitary confinement being used in New Zealand is unlawful.
The complainants say they were subjected to psychological torture and inhumane conditions.
Their lawyer, Tony Ellis, says inmates several prisons were put on special behaviour management regimes or placed in solitary confinement as punishment.
He told the court that they were held for too long in small windowless cells which were brightly lit 24 hours a day. Ellis said the inmates were completely isolated from the rest of the prison population. He said some of the inmates were held in such conditions for over two years.
The prisoners are behind bars for crimes including murder, armed robbery and rape. But Ellis said they had been treated cruelly and their care did not meet minimum international standards.
He said inmates were kept in solitary confinement for up to 23 hours a day, their cells didn't have adequate ventilation or natural light and they weren't allowed outside to exercise. Ellis told the court six inmates had to share one bucket and mop to clean their cells.
Inmates also claim they were given only eight minutes a day to wash themselves.
Most of the complaints come from inmates who have spent time in Auckland's Paremoremo Prison behaviour management regime - BMR.
The special unit was set up in 1998 after inmates rioted. Inmates are put there as punishment for violence and are isolated from other inmates.
But prisoners from other jails around the country have also complained they were kept in solitary confinement for no good reason.
Four of the inmates, who are in custody, attended court. They sat in the public gallery and although they weren't handcuffed each was flanked by a prison guard.
One of them was convicted murderer Christopher Taunoa. He claims he spent over two years in the BMR and afterwards needed psychiatric help.
Lawyers for the Corrections Department, Attorney General and prison bosses say they'll defend the prisoners' claims.