On February 21, 2015, a man was booked into the Maricopa County Jail, a sprawling complex in Phoenix where the dusty Arizona landscape is interrupted by the occasional palm tree. We'll call him by his initials: JP. According to JP's booking report, he was experiencing auditory hallucinations during his intake, and acting "bizarre," like he was high or drunk. His report also said he had a prior diagnosis of bipolar disorder, and had previously attempted suicide.

During JP's first weeks in the jail, guards observed him "spitting and urinating" on the floor of his cell, exhibiting "tearful" behavior, and burping or drooling to drown out the voices he was hearing. He refused to eat or take the antipsychotic drugs he'd been prescribed. By the time he was finally taken to the facility's Mental Health Unit (MHU) on March 11, he had lost 20 pounds and was "tangential, unaware of his situation, and reported auditory and visual hallucinations," according to an MHU admission report. He stayed one day before being sent back to the regular jail.

His condition continued to worsen for months — he wouldn't shower, eat, or take his medication. It wasn't until June that he was transferred to an RTC, a residential rehabilitation program, after a criminal court judge agreed with jail officials that he was too "incompetent and unrestorable" to face trial.

The case was one of 47 detailed in a lawsuit filed on Friday by the American Civil Liberties Union against Sheriff Joe Arpaio, who oversees the Maricopa County Jail. The ACLU alleges that Arpaio — who touts himself as "America's toughest sheriff" — essentially warehouses mentally ill detainees in "punitive housing units" at the jail. Without access to treatment, the lawsuit claims, these troubled individuals "deteriorate, refusing medication and treatment, living in squalor and growing more symptomatic by the day."

The suit was filed alongside a lengthy report by Dr. Pablo Stewart, a psychiatrist who visited three Maricopa County jail facilities and its lockdown units between February and August 2015, and used inmate medical records, court filings, and his own experiences from other jail systems to draw his conclusions.

Stewart found that the jail lacked "a reliable system" to "ensure to timely transfer of seriously ill prisoners to an inpatient psychiatric facility." He found that the care of mentally ill prisoners housed in regular outpatient facilities was "dangerously inadequate."

The lawsuit is the result of a lengthy campaign by the ACLU to improve conditions at the Maricopa County Jail, which have allegedly included feeding detainees "moldy bread, rotten fruit and other contaminated food, housing them in cells so hot as to endanger their health, denying them care for serious medical and mental health needs and keeping them packed as tightly as sardines in holding cells for days at a time during intake."

Arpaio and his staff did not respond to multiple phone calls and written requests for comment from VICE News regarding Stewart's report and the ACLU lawsuit.

Sheriff Joe Arpaio talks with news media as well as protestors outside of the Fourth Avenue Jail in Phoenix on July 19, 2010. (Photo by Darren Hauck/EPA)

In 2008, a federal judge issued a court order that said Arpaio had to end overcrowding in his jail facilities and provide adequate medical and mental health care. Arpaio has repeatedly sought to terminate the order, which was extended in 2014.

Part of the order required the jails to provide appropriate mental health services or transfer mentally ill inmates to facilities that are equipped to handle them. It also said that all pretrial detainees who "display active symptoms of mental illness" should be seen face-to-face by a doctor at the MHU within 24 hours of their referral.

Stewart, however, found that jail officials frequently skewed their own data in order to comply with the federal court order. After he sifted through hundreds of records, he found numerous instances where an inmate's behavior urgently required face time with a psychiatrist. These incidents were allegedly excluded from the data jail officials included in their compliance reports. Stewart found that some troubled inmates who experienced hallucinations and appeared to be at risk of self-harm or suicide were left waiting up to two weeks for help.

Some detainees were so impaired that they were deemed unfit to stand trial. As a result, their cases are at a standstill, and they're stuck waiting indefinitely in the jail's lockdown unit. Instead of being sent to local hospitals to receive treatment, Maricopa County often relegates mentally ill detainees to solitary confinement, where their problems are often exacerbated, according to the lawsuit.

Eric Balaban, a senior staff counsel with the ACLU's National Prison Project and one attorneys working on the lawsuit against Arpaio, says Maricopa County's mentally ill detainees become caught in a vicious cycle without ever being stabilized. He estimates that about 20 percent of the prison's inmates have a mental illness that requires treatment, "on average, about 1,400 men and women at any one time," he told VICE News.

According to Stewart's report, one female detainee wrote on a wall with her own feces, repeatedly flooded her cell, was frequently observed to be in "obvious distress," and was prone to outbursts of screaming and swearing. She was primarily housed in a regular ward at Maricopa County's Estrella Jail, rather than the MHU.

Another female detainee reportedly spent a year shuffling between solitary confinement at Estrella and the MHU. During the woman's prolonged stints in confinement, Stewart said, her behavior became increasingly psychotic. According to records, her cell was littered with garbage, she would smear menstrual blood over her face, put her uniform in the toilet, and pull out her hair to eat it. Two days prior to her discharge from one of her stays at the MHU, the in-house psychiatrist described her as "confused and disoriented," and possibly "responding to perceptual disturbances."

There are typically two tiers of mental health care in the Maricopa County Jail. The first is the MHU, which consists of a 60-bed inmate infirmary for acute patients and a 268-bed psychiatric unit, where inmates must meet admission criteria in order to be referred. In his report, Stewart found that admission criteria to the MHU is too high — it requires a recent suicide attempt by the inmate — and that discharge criteria too low. In many cases, detainees were admitted for just one or two nights before being discharged to the regular jail.

Watch the VICE News documentary Institutionalized: Mental Health Behind Bars:

Balaban noted that Maricopa County handles its mentally ill inmate population differently than many other jails across the country. Specifically, its residential rehabilitation program is on site rather than in a hospital, which, according to Balaban, makes it unavoidably punitive. He said RTC programs in hospitals usually encompass "a wider range of psychosocial activities," giving the patient more opportunities to interact and recover alongside others.

The motion filed by the ACLU on Friday seeks a court-enforced mandate for the transfer of severely mentally ill detainees to psychiatric facilities outside the Maricopa County jail system.

This is hardly the first time Arpaio and his notorious jail has come under fire. The 83-year-old sheriff is known for his unorthodox and often draconian ways of doing things at Maricopa County Jail, like housing inmates in a "tent city" despite the blistering Arizona heat, reinstituting chain gangs, and forcing detainees to wear pink underwear.

"Too many jails in this country are just shy of being like hotels," Arpaio has said previously, defending the conditions in his jail. "That isn't right. I keep saying, 'People shouldn't live better in jail than they do on the outside.' Here in my jails, they don't."

Arpaio's staff also mishandled or completely neglected some 400 sex crimes that were reported in the Phoenix area between 2005 and 2007. Officials cited a high caseload to explain why they had failed to investigate hundreds of cases, which, in some instances, left dozens of underage rape victims high and dry. "If there were any victims, I apologize to those victims," Arpaio said at the time during a press conference.

In 2010, after an FBI investigation and grand jury probe, a federal judge found that the sheriff had indeed "misused the power of his office" by bringing bogus criminal investigations against his political opponents. In 2011, Maricopa budget officials found that Arpaio misspent or misused almost $100 million. Those funds were allocated for use on jail items and inmate services. Instead, Arpaio blew that money on investigations into his political opponents and counter-trafficking operations. In 2013, following a class action suit brought by the ACLU, a US District Court judge found that Arpaio had "relied on racial profiling and illegal detentions to target Latinos."

According to a report last year by the Arizona Republic, since Arpaio first took office in 1992, cases involving him or his office have cost Arizona taxpayers $142 million in legal expenses, settlements, and court awards.

Despite his legal woes, Arpaio has frequently been re-elected by double-digit margins. His approval rating topped 70 percent for years, but recently slipped to around 38 percent last year. Nevertheless, the sheriff is seeking re-election again in 2016.