PHILADELPHIA (AP) — Pennsylvania prisons can no longer keep former death-row inmates in solitary confinement after their sentences have been changed.

The U.S. Court of Appeals for the 3rd Circuit on Thursday ruled that inmates who were slated for capital punishment but later received new sentences have a right to avoid solitary confinement. The three judges serving on the panel cited the harmful psychological effects of lone imprisonment.

READ MORE: Former US Army Reservist Timothy Hale-Cusanelli Found Guilty In Jan. 6 Capitol Riot

Pennsylvania’s prisons will be required to reintroduce those inmates to the general population, if deemed safe.

READ MORE: CBS3 SummerFest: Be Prepared To Spend More At The Jersey Shore This Summer

The decision stemmed from two lawsuits filed by Philadelphia men who were sentenced to death but later received new sentences. Both sought damages for the extra years they spent in solitary.

Copyright 2017 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

MORE NEWS: 'Do Your Jobs': Pennsylvania Gov. Wolf, Advocates Rally For Stronger Gun Laws