The U.S. Supreme Court's decision to retroactively ban automatic life sentences without parole for youths convicted of murder is an important step in the country's evolving attitude toward juvenile justice.

When the court first banned mandatory life without parole in 2012, it recognized that juvenile offenders have the possibility of being rehabilitated as they mature. But that ruling only applied to cases going forward. The court's decision Monday requires new sentencing hearings for juveniles convicted before 2012. That affects 1,500 inmates across the country. About 500 of them are imprisoned in Pennsylvania, and about 300 of that number were convicted in Philadelphia courts.

The new ruling doesn't prohibit state courts from ordering life-without-parole sentences. But before imposing a life sentence, a judge must consider whether a lesser prison term would be more appropriate. The majority opinion, written by Justice Anthony M. Kennedy, clearly restricts the harshest sentences for the "rare juvenile offender who exhibits such irretrievable depravity that rehabilitation is impossible and that life without parole is justified."

The case before the Supreme Court concerned Henry Montgomery, a Louisiana inmate who was 17 when he shot and killed a sheriff's deputy in Baton Rouge in 1963. Prison officials say Montgomery has become a model prisoner who mentors younger inmates. Like Montgomery, many inmates waiting to die in prison for crimes they committed as juveniles have probably changed.

Several states, including Louisiana, Michigan, and Pennsylvania, were reluctant to reopen cases after the court's previous ruling voiding life-without-parole sentences for juveniles. Pennsylvania did pass a law reducing the mandatory murder sentence for juveniles to 35 years for defendants 15 and older and 25 years for those younger than 15. But it was not applied retroactively.

The bill's sponsor, Senate Judiciary Committee Chairman Stewart Greenleaf (R., Montgomery), said it wasn't clear whether further legislation was needed or whether judges would be bound by the new guidelines in resentencing hearings. The logistics of reopening so many cases are daunting. Philadelphia District Attorney Seth Williams said his office was reviewing its options.

Meanwhile, the ruling on juvenile sentencing sets the stage for Pennsylvania to take an even bigger step: It should drop most mandatory minimum sentences. Mandatory sentences undermine judicial discretion and have largely proven useless in reducing crime. Inmates who serve long terms without the prospect of early release are more likely to come out hardened rather than rehabilitated. That doesn't make society safer.