The Supreme Court on Monday ruled that its 2012 decision banning mandatory life-without-parole sentences for juvenile killers must be applied retroactively, granting a new chance at release for hundreds of inmates serving life sentences without the possibility of parole for murders they committed in their youth.

The vote was 6 to 3, and the majority decision was written by Justice Anthony M. Kennedy, the court’s leading proponent of cutting back on the death penalty and other harsh punishments for entire classes of offenders. His opinion strengthened the 2012 decision, which merely required new sentencing where life without parole had been imposed automatically, without taking into account the defendant’s youth.

Monday’s opinion indicated that life-without-parole sentences for juvenile offenders should be exceedingly rare. Justice Kennedy also gave states a second option — instead of resentencing the affected prisoners, they could make them eligible for parole.

The case, Montgomery v. Louisiana, No. 14-280, concerned Henry Montgomery, who was 17 in 1963 when he murdered an East Baton Rouge police officer. He is now 69.