The U.S. Supreme Court has upheld a cap on California’s prison population that was imposed by a three-judge federal panel to reduce prison overcrowding and improve inmate health care.

At the time the cap was imposed, it could have resulted in the release of 46,000 prisoners. Since then, 9,000 prisoners have been released, reducing the potential number of prisoners that could be freed under the order to 37,000.

The U.S. Supreme Court’s 5-4 decision on Monday found that the cap was authorized by the Prison Litigation Reform Act and needed to combat violations of inmates’ constitutional rights to medical and mental-health care. Justice Anthony M. Kennedy wrote the majority opinion (PDF).

The potential release of prisoners under the cap is “of unprecedented sweep and extent,” Kennedy wrote, but “so too is the continuing injury and harm resulting from these serious constitutional violations.”

An appendix included two photos of crowded prison conditions and a third showing the small cells for people waiting for a bed for mental-health crises.

Before the cap was imposed, California prisons were housing nearly double the numbers they were designed to hold. Under the lower-court order, the state was required to reduce the prison population over a two-year period to 137.5 percent of the design capacity.

“For years the medical and mental health care provided by California’s prisons has fallen short of minimum constitutional requirements and has failed to meet prisoners’ basic health needs,” Kennedy said. “Needless suffering and death have been the well-documented result.”

Kennedy acknowledged public safety concerns, but noted findings that the prison population could be reduced in a way that does not increase crime to a significant degree. As the state of California implements the order, Kennedy wrote, officials may find effective remedies that will end the constitutional violations without a significant decrease in the prison population. In that case, the state can apply for a modification of the cap.

Dissenting Justice Antonin Scalia decried the “outrageous result” and said the Supreme Court majority has affirmed “perhaps the most radical injunction issued by a court in our nation’s history.” He was joined by Justice Clarence Thomas. “The court disregards stringently drawn provisions of the governing statute, and traditional constitutional limitations upon the power of a federal judge, in order to uphold the absurd,” Scalia wrote. He read a summary of his dissent aloud from the bench.

Scalia disagreed with the notion of an Eighth Amendment class action based on “systemwide deficiencies” and questioned whether the plaintiffs who will benefit from the cap were affected by poor health care. “Most of [those released] will not be prisoners with medical conditions or severe mental illness; and many will undoubtedly be fine physical specimens who have developed intimidating muscles pumping iron in the prison gym,” Scalia said.

Justice Samuel A. Alito Jr. wrote a separate dissent, joined by Chief Justice John G. Roberts Jr. They argued the three-judge panel exceeded its authority under the Constitution and the Prison Litigation Reform Act. The lower court ordered a “radical reduction” in prison population, Alito said, without finding that the current population violates the Constitution. The remedy should instead have been narrowly tailored to address the health-care violations, he wrote.

“The prisoner release ordered in this case is unprecedented, improvident, and contrary to the PLRA,” Alito wrote. “In largely sustaining the decision below, the majority is gambling with the safety of the people of California.”

The case is Brown v. Plata, formerly Schwarzenegger v. Plata. An ABA amicus brief filed in the case said the lower court order should be affirmed because it appropriately gave California prison officials the discretion to determine how to reduce prison population. The brief relied on the ABA’s Standards on Treatment of Prisoners, ABA President Stephen Zack said in a statement Tuesday in which he commended the Supreme Court’s ruling.

“The decision also gives California broad latitude in determining how to reduce its prison population, and cites several examples that can be accomplished without adverse effect on public safety,” Zack said.