Pennsylvania’s high court on Thursday overturned the use of automatic life sentences without parole for people convicted of second-degree murder, saying it violates the state’s constitutional ban on cruel punishment when imposed without a closer look at the defendant’s specific role and culpability.

The court majority ordered resentencing in the case of Derek Lee, convicted of a 2014 killing in Pittsburgh, but the decision also has implications for others among the roughly 1,000 other inmates currently serving similar second-degree murder sentences.

The court’s order was put on hold for four months to give the General Assembly time to “consider appropriate remedial measures.” In a footnote, the justices said they were ruling on Lee’s sentence and not addressing “questions of retroactivity.”

Prison reform groups hailed it as a landmark decision, while the Allegheny County district attorney’s office said it will follow the court’s order.

Pennsylvania law has made people liable for second-degree murder if they participated in an eligible felony that led to death, and life without parole has been the only possible sentence.

“The mandatory penalty scheme of life without parole for all offenders convicted of second degree murder fails to assess individual culpability regarding the intent to kill, and mandates the same punishment regardless of that culpability,” wrote Chief Justice Debra Todd in the lead opinion. She characterized it as not distinguishing “between the lookout, and the killer who pulls the trigger.”

The state high court’s decision comes after years of advocacy to undo mandatory life without parole sentences both in Pennsylvania and nationally. Nazgol Ghandnoosh of the Washington-based Sentencing Project said she counts 11 states and the federal system as having such laws for that kind of crime, sometimes called felony murder. Several states — California, Colorado and Minnesota — have moved away from that sentencing framework in recent years, she said.

Justice Kevin Dougherty noted in a separate opinion that unlike those convicted of first-degree murder, defendants serving life without parole for second-degree murder have “never been found by a judge or jury to have harbored the specific intent to kill” and may not have had “any involvement whatsoever with the actual killing. He or she does not even have to expect or foresee that a life may be taken.”

Lee’s lawyers had wanted the court to rule that life without parole sentences are unconstitutional for all second-degree murder convictions in Pennsylvania, said Quinn Cozzens, a staff attorney for the Abolitionist Law Center, which helped represent Lee. Instead, the court ruled that trial judges must examine the individual circumstances of a defendant’s case to decide which sentence is most appropriate, including the potential of life without parole.