SACRAMENTO (CBS SF) _ State corrections officials have agreed to shift mentally ill inmates into specialized housing units instead of placing them in isolation, a decision that marks a major shift in how the system deals with such prisoners.

The agreement filed Friday in U.S. District Court in Sacramento comes after a federal judge ruled in April that California’s treatment of mentally ill inmates violates constitutional safeguards against cruel and unusual punishment.

READ MORE: IRS Website Will Soon Require Facial Recognition To Log Into Your Account

He acted after the release of videotapes that showed guards pumping large amounts of pepper spray into the cells of mentally ill inmates.

READ MORE: Apple Music Trolls Spotify By Calling Itself 'The Home Of Neil Young' After Streaming Service Pulls Songs

The state will create separate short- and long-term housing units for mentally ill inmates who prison officials say must be kept in solitary confinement. The agreement also calls for them to get more treatment and more time outside.

MORE NEWS: California Secretary of State: Reparations Should Be Limited To Descendants of Slaves

© Copyright 2014 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.