NEW ORLEANS (AP) — A Louisiana prison’s treatment of its mentally ill prisoners — including inadequate care, incomplete medical records and prolonged stints in solitary confinement — violates federal law and the Constitution, a federal judge has ruled.

U.S. District Judge Elizabeth Foote’s 165-page ruling states that officials at the David Wade Correctional Center have used solitary confinement, also referred to as “extended lockdown,” as “a depository” for mentally ill prisoners that only worsens their mental illnesses.

The Shreveport-based judge’s ruling, dated Tuesday, is the latest development in a 2018 lawsuit filed by criminal justice advocates on behalf of inmates at the prison in north Louisiana’s Claiborne Parish. Her findings were based on evidence of prisoner treatment prior to March 2020. Next in the case comes a January “remedy phase” in which the state will have to show what it has done to correct the problems. After that, the court will step in to force changes if needed, Foote wrote.

The state has denied the accusations in the lawsuit. “We strongly disagree with the ruling,” Department of Public Safety and Corrections spokesman Ken Pastorick said in an email. He declined further comment, citing pending litigation.

Melanie Bray, lead attorney on the case for Disability Rights Louisiana, applauded the ruling.

“When people with mental illness are sent to the state prison as punishment for a crime, the state has an obligation to provide baseline mental health care,” Bray said in a news release. “The proof in this case showed that there was virtually no mental health care at DWCC, and that men there are suffering greatly as a result of the state’s indifference.”

Attorneys with the American Civil Liberties Union of Louisiana, the Promise of Justice Initiative and the law firms of Adams & Reese and Cohen Milstein also worked on the case.

Foote rejected allegations by the inmates’ lawyers that the prison officials engaged in retaliation against inmates involved in the suit, or that First Amendment rights were violated through the censoring of mail.

But she was highly critical of the prison’s treatment of mentally ill prisoners, saying they were “deliberately indifferent” while housing inmates in inhumane conditions. Those conditions violated Eighth Amendment protections against cruel punishment, as well as the Americans with Disabilities Act, Foote ruled.