South Carolina's correctional officers routinely have to protect prisoners from each other, and they have to guard against being harmed by inmates. But they're not so practiced at protecting prisoners from themselves.

In recent months, however, they have received extra state money and have taken much needed steps to improve the way they manage mentally ill prisoners.

It would make sense for the mentally ill to be treated in hospitals, not prisons. But funding for the S.C. Department of Mental Health has suffered severe cutbacks. That means prisons are seeing more mentally ill inmates.

For too long, S.C. Department of Corrections, also seriously underfunded, tried to treat those prisoners the way they treat other prisoners. But early this year, then-Circuit Judge Michael Baxley handed down a scathing ruling, after lengthy testimony about prisoners spending years in solitary confinement, being left in cells covered with feces and receiving inadequate health care.

He gave SCDC six months to come up with a plan to fix things.

SCDC has appealed, but it is wisely moving forward with some necessary reforms.

Unfortunately, the state consistently has been at or near the bottom for prison spending nationally.

Last year, legislators allocated the department $1.2 million to hire more counselors and improve mental health care for inmates.

Sadly, that is nowhere near enough to pay for the changes Judge Baxley ordered. In 2010, at least five times more mentally ill people were housed in jails and prisons than in hospitals.

It doesn't appear the money-starved Department of Mental Health can help. Certainly, the Legislature needs to strongly reconsider its pitiful support for mental health care.

But SCDC doesn't have the luxury of waiting for more money to come its way. It recently opened a unit at Kirkland Correctional Institution in Columbia to house prisoners who harm themselves.

Its 23 beds are unlikely to meet the need. But it will be a sound way to test whether that strategy works and whether three counselors, a psychiatrist and a clinical assistant assigned to the unit are adequate. The idea is to have trained people readily available to respond when an inmate feels the urge to hurt himself.

SCDC also brought in a team from the National Institute of Corrections to train 25 correctional officers in crisis intervention. Some of them will work in the new Self-Injurious Behavior Unit. Some will train more security staff in crisis intervention.

The department also designated special dorms for mentally ill prisoners at Lieber, Lee and Perry state prisons.

Given the breadth of the problem of mentally ill prisoners, SCDC will almost assuredly have to do more to meet their needs - and to comply with the judge's orders.

And the S.C. General Assembly needs to recognize that, by shortchanging SCDC and DMH for years, it is complicit in the problem and must contribute to the solutions.