For decades, California’s Legislature, governors and a parade of experts in managing state prisons have been unable to fix the state’s overgrown, bloated prison system. Now the U.S. Supreme Court must decide whether three federal judges have the power to do the fixing for them.

In arguments set for Tuesday, the nation’s high court will review a federal court’s unprecedented ruling last year that required the state to shed nearly 40,000 inmates from its 33 prisons to relieve an overcrowding problem deemed so severe that it violates the constitutional ban on cruel and unusual punishment.

The Schwarzenegger administration appealed the ruling, setting up the final showdown in a long-running legal battle triggered by allegations that the overstuffed prisons are depriving inmates of adequate medical and mental health care. Conditions were deemed so bad that one of the federal judges found inmates were “dying needlessly” on a regular basis.

The case also has sweeping ramifications for state prisons across the country, many of which are encountering similar problems at a time when state budgets are too tight to offer much relief. Eighteen states, from Massachusetts to Alaska, have joined California in the case, warning the Supreme Court in a brief that the federal court order “needlessly threatened public safety” and that such “orders inevitably place innocent citizens at much greater risk of victimization.”

“The implications are huge not just for California, but for every state in the nation,” said Joan Petersilia, a Stanford University law professor and expert on prison issues. “California in many ways gets seen as the big kahuna, and kind of the worst in terms of prison crowding. But there are other states that are pretty close.”

At its core, the case pits the ability of states such as California to rectify their own problems against the powers of federal judges who are forced to step in and order sweeping reforms when a prison system fails to address chronic shortcomings. The Supreme Court will be reviewing whether the three-judge panel overstepped its authority to order inmate releases under a 1996 federal law that in many ways restricted the federal courts’ ability to issue such orders.

In last year’s ruling, the three-judge panel concluded that prison overcrowding is the root cause of inadequate medical and mental health care for inmates, and stressed that California prison officials and politicians had failed for years to devise their own solutions. The order required California to reduce its inmate population to 137 percent of prison capacity, which would call for ridding about a quarter of the inmates from the prison system through a variety of measures, including releasing low-level, nonviolent offenders early and sending more inmates to out-of-state prisons.

At one point, the judges threatened Gov. Arnold Schwarzenegger with contempt if he did not comply with the orders. The governor did devise a sweeping plan to reduce the inmate numbers, including some new prison construction, but at the same time appealed the order to the Supreme Court.

Lawyers for the inmates argue that the state cannot be trusted to carry out the needed reforms without the court-ordered deadline.

“The prisons are still way overcrowded,” said Don Specter, one of the lead attorneys for inmates. “The state is arguing for an interpretation of the law which would make any kind of order impossible.”

Both Schwarzenegger and Gov.-elect Jerry Brown have insisted that federal judges are trampling on the state’s right to take care of its prison overcrowding problem. And, Matthew Cate, secretary of the California Department of Corrections and Rehabilitation, maintains that the judges aren’t giving the state time to follow through with many of the reforms that everyone agrees are needed and that have already slimmed the inmate population by about 8,000 since the system’s 2006 peak.

“If we get a release order, we could find ourselves having a difficult time complying with that order without imperiling public safety,” Cate said in an interview last week. “Thirty-five thousand inmates is the equal of (emptying) seven prisons in a single day.”

Legal experts predict the state may have a strong argument in the Supreme Court, which is decidedly more conservative on law-and-order issues than the three judges who issued the California order, 9th Circuit Judge Stephen Reinhardt, San Francisco Federal Judge Thelton Henderson and Sacramento Federal Judge Lawrence Karlton, all of whom are Carter appointees with liberal reputations.

But Jonathan Simon, a UC Berkeley law professor following the case closely, said the justices may still be reluctant to tamper with the overall factual findings of the three-judge panel, although they may decide the courts need to give the state “more leeway” to comply with the orders. And, Stanford’s Petersilia added, the order has already served a purpose, given the decline in inmate population in recent years.

“Without the court order, we wouldn’t have gotten here,” she said. “They weren’t getting it done to the extent they got it done the last two years.”

Contact Howard Mintz at 408-286-0236.