The state prison in Monroe is the largest psychiatric facility in Snohomish County.

As if that’s not depressing enough, the Monroe Correctional Complex is large enough to rank just behind Western State Hospital as the second largest in the state.

No humane person thinks prisons are the right place to treat the mentally ill, including the folks who run Washington’s prisons.

But left to pick up the pieces of the state’s fractured mental-health system, they are leaning into the job. Quietly, the state Department of Corrections has carved out treatment programs at all custody levels, from maximum custody to work release, and has encouraged among corrections staff a sea change in thinking about the mentally ill.

“When systems can’t say no, they’re much more interested in solving the problem,” said Bruce Gage, the DOC’s head psychiatrist. “Here at the Department of Corrections, we don’t have anyone else to turn to, so we can’t say no.”

Monroe, the nearest prison to Seattle, is the locus of this experiment, with nearly 500 beds focused on mentally ill offenders.

The most recent investment in mental health care came in August, when the DOC bought and bolted to the floor oversized school desks in a classroom within the prison’s solitary confinement units, known in prison lingo as Intensive Management Units.

Twice a week since August, offenders are let out of solitary for hours of cognitive behavior therapy classes. I watched one class recently as four offenders, in orange jumpsuits shackled to the desks, went through something like a group therapy lesson.

Not surprisingly, Intensive Management Units are a magnet for the mentally ill, because of their own erratic behavior or as protection from other offenders. One study of the state’s Intensive Management Units estimated 45 percent of isolated offenders had mental illness or traumatic brain injuries. They tend to stay for years, and often return right back to solitary once they’re released to the general population, their illness worsening.

One of them is Danie Perez, 27. While serving a vehicular homicide sentence, he killed his cellmate in 2006 and attempted to kill another in 2009 because “God was making him do things,” according to The (Everett) Herald. He has been in and out of solitary confinement for four suicide attempts and 18 attempts at self-mutilation.

“It’s difficult to survive” being in solitary confinement, said Perez, who won’t be released from prison until he is 76. “I hurt myself.”

This class — group lessons within solitary confinement — is cutting-edge thinking in corrections. Also used elsewhere in Washington’s prison system, it’s proven to cut use-of-force incidents, protecting officers, and to reduce infractions among the most troubled offenders.

But as I watched the class, I wondered about what we — as a state, as a nation — must do with a man like Perez.

His acts — murder, attempted murder — merit severe punishment. But his illness is indistinguishable from that of patients at Western State Hospital.

And even with the DOC’s forward-thinking mental-health programs, he is assured a level of treatment to let him survive, not recover. Mental illness in prison is a weakness, and the weak are prey. Offenders in the general population mock psychiatric units as “ding wings,” dispensing “ding biscuits” as medications.

By Gage’s estimate, between 20 and 30 percent of Washington’s 16,700 inmates are mentally ill. When I asked why, Gage, who spent two decades at Western State Hospital before switching to the DOC, went broad.

“It used to be called deinstitutionalization,” said Gage. “Now it’s called trans-institutionalization. We took everyone out of the state hospitals, and they pretty much, the same population, ended up in prisons and jails.”

The jailing of the mentally ill cannot honestly be called an accidental byproduct of the nation’s fractured mental-health system. The disinvestment in mental health care has gone on too long — generations now — to be considered anything but deliberate neglect.

In 1955, before deinstitutionalization, there was one psychiatric bed for every 300 U.S. residents. A half-century later, that ratio is now 1 in 3,000.

That has led to another telling ratio: For every one person in a public or private psychiatric bed in Washington, there are 3.1 people with serious mental illness in the state’s jails and prisons, according to the Treatment Advocacy Center. Nationally, the ratio is 3.2 to 1.

And that is a crime.

Jonathan Martin’s column appears regularly on editorial pages of The Times. His email address is jmartin@seattletimes.com