Pennsylvania prison officials are promising to provide specialized treatment for mentally ill inmates in a settlement of a lawsuit filed by advocates for disabled.

In the settlement announced Tuesday, the state agreed to divert inmates with serious mental illness into special units rather than placing them in isolated housing where advocates say hundreds of prisoners languished in isolated cells for months and even years.

Corrections Secretary John Wetzel says the agreement between his department and the Disability Rights Network of Pennsylvania reflects their mutual goal of delivering safe and appropriate mental-health services.

The network's CEO, Peri Jude Radecic, says the settlement will remove the harsh conditions of restricted housing and provide services, rather than punishment, for mentally ill inmates so they stay on track for parole.