HARRISBURG, Pa. — A federal civil rights investigation has concluded that a state prison in western Pennsylvania kept inmates with serious mental illness in solitary confinement for months or even years at a time.

The Pennsylvania Department of Corrections plans to close Cresson, but the Justice Department said the misuse of solitary confinement could extend to prisons statewide. The department is expanding its probe to include all state prisons.

The administration of first-term GOP Gov. Tom Corbett said it will review the findings and continue to cooperate with the Justice Department probe.

Corbett’s Corrections secretary, John Wetzel, identified mental health as an area needing improvement early in the governor’s tenure, and has been working on improvements, Department of Corrections spokeswoman Susan McNaughton said Friday night.

“We found that Cresson often permitted its prisoners with serious mental illness or intellectual disabilities to simply languish, decompensate, and harm themselves in solitary confinement for months or years on end under harsh conditions in violation of the Constitution,” Roy L. Austin Jr., deputy assistant attorney general for civil rights, said in a statement.

The Justice Department said Wetzel and his staff are cooperating fully with the probe and have been receptive to the agency’s concerns.

McNaughton said the staff has been trained in crisis intervention for mentally ill offenders, and that a new policy will place seriously mentally ill inmates in treatment when they first enter the system, among other improvements.

“Systemic improvements do not and cannot occur overnight, but we have a better system today than we did a year ago, and we are confident we will have a better system next year than we do today,” McNaughton said via email.