COLUMBIA - South Carolina's prisons agency has amassed more than $800,000 in legal bills defending accusations of poor care for mentally ill inmates.

The Greenville News reported Wednesday that a spokesman confirmed the Department of Corrections had spent $838,000 on the case.

Last month, Circuit Judge Michael Baxley sided with a group of mentally ill inmates who sued the Corrections Department in 2005, saying their treatment violates constitutional standards. Baxley also gave the agency six months to come up with a plan to fix the issues.

Prison officials have released a list of actions they've taken in recent years to address the handling of mentally ill inmates. The department has asked Baxley to amend his ruling. The agency has said it may appeal if that request is denied.