Media playback is unsupported on your device Media caption "You put a dog in a cage away from people, and you release that dog, he's going to bite," one SHU inmate told BBC Newsnight

California, the most populous state in the US, holds some inmates of its overcrowded prisons in isolation for years, even decades. While officials defend the use of the "security housing units", inmates and their lawyers say they turn their occupants mad.

The US has more criminals locked up than any other country.

And tens of thousands of those prisoners nationwide are confined on their own in small cells for an average of 22 hours a day. Ten hours a week of exercise is done in a small, individual yard.

Their time in isolation is overwhelmingly counted in months or years, rather than days or weeks.

Those who have spent time inside California's isolation cells, which are known as security housing units or "the SHU", consider them a modern equivalent of "the hole".

But prison officials do not see this style of incarceration as "solitary confinement". Those working within the prison system say that solitary isn't as bad as it looks in the movies.

'The real McCoy'

Image caption California's prisons are notoriously overcrowded

"We tend to move away from a traditional definition of solitary confinement," said Martin Hoshino, the acting head of California's corrections department.

"It was a definition in prisons and corrections going back probably 100-150 years, and it tends to be associated with images of people isolated in dark boxes or even… chained to a wall by themselves where there's no human contact."

Not everyone agrees with their assessment. And the United Nations Special Rapporteur on Torture, Juan Mendez, wants to visit California's SHUs.

"My main concern has been solitary confinement - not just because it is used very pervasively," he said.

"No-one knows for sure but I've seen estimates of 4,000-12,000 people in solitary confinement in California alone on any given day."

This is solitary confinement, this is the real McCoy Michael Bien, Lawyer

UN officials use the word "torture" when talking about solitary confinement for more than 15 days.

Now, the courts are being asked to step in and force the state's prison service to change. A panel of judges already declared California's overcrowded prisons unlawful and ordered the population reduced by a quarter in two years.

Lawyer Michael Bien has represented inmates in a class-action challenge over prison conditions since 1990.

"In prison systems around the world, 30 days in solitary used to be 'Oh my God, 30 days in solitary?' That's a joke in California. They could give you 30 days before you even have a hearing," he said.

"This is solitary confinement, this is the real McCoy. And you can call it whatever name you want, but it has the same horrible effect on human beings who are subject to it."

Prisoners who have spent time in the SHU consider it to be both solitary confinement and a form of torture.

Like dog kennels

Media playback is unsupported on your device Media caption Official videos show the violent "extraction" of mentally ill prisoners from their cells in California

Both Francisco Carranza and Vicente Garcia, prisoners at California State Prison, Sacramento, compared their treatment to that of dogs locked in a cage.

"On the street I kept pit bulls and had dog kennels about the same size as the cells on the yard," said Carranza, who has spent 12 years in isolation.

"I didn't let them around other people, so they would be mean. That's pretty much how we're kept here."

Carranza is bipolar and schizophrenic and believes his mental condition is worsening over time.

In a country lacking adequate public mental health care, many mentally ill individuals end up in jail. Mr Bien is also challenging the treatment of California's mentally ill prisoners.

"This is a dangerous place for prisoners with mental illness," he said. In a recent case, he presented a number of videos, filmed by California Department of Corrections and Rehabilitation officers, as evidence of maltreatment.

The videos show disturbing images of prisoners being sprayed with large quantities of pepper gas before being pulled out of their cells naked, then restrained.

Acting prisons chief Martin Hoshino said these videos were the exception and that such "extractions" followed several hours of non-violent persuasion. But he admitted procedures were under review.

'A necessity'

Image caption SHUs at Corcoran State Prison

California's Supermax prisons were designed in the 1980s for isolation and mass incarceration during an era of rampant prison gang violence.

David Warren, a volunteer Jewish chaplain in the California state prison system, believes there is a role for prisoner isolation.

"Regretfully, they are an abject necessity in the prison society environment," he said, citing the gang problem.

"There is a significant group of individuals who feel no social constraints concerning violence… who can do anything they like… unless we have some place to segregate them from the general population of the prisons."

Two-thirds of ex-convicts in California re-offend, and suicide levels are higher among those who have served time in the SHUs.

"I wouldn't say that it's wrong," argues Mr Hoshino. "I would say that it is an appropriate time for us to re-examine who actually is in the Security Housing Units and for how long."

See more from BBC Newsnight on the BBC iPlayer and the Newsnight website.