Connecticut officials have agreed to stop housing many mentally ill people in nursing homes in a proposed settlement of an 8-year-old lawsuit involving more than 200 psychiatric patients.

Advocates for the mentally ill and officials with three state agencies signed off three weeks ago on the proposed settlement of the federal class-action lawsuit, according to court records obtained by The Associated Press. U.S. District Judge Alvin Thompson has scheduled a fairness hearing in Hartford on the settlement for July 1.