The U.S. Supreme Court ruled Monday in Montgomery v. Alabama that its ban on mandatory life-without-parole sentences for juvenile offenders also applied retroactively, making more than 2,000 inmates nationwide eligible for resentencing or the possibility of eventual freedom.

The Court ruled four years ago in Miller v. Alabama that states could not sentence juvenile defendants to die in prison without considering their maturity, upbringing, or potential to reoffend, citing their lessened culpability as minors at the time of the crime. That ruling only applied to ongoing and future cases; Montgomery sought to apply it to final sentences nationwide.

Based on the Court’s precedents, Justice Anthony Kennedy wrote for the six-justice majority, “prisoners like Montgomery must be given the opportunity to show their crime did not reflect irreparable corruption; and, if it did not, their hope for some years of life outside prison walls must be restored.” States may choose either to hold resentencing hearings for each of the prisoners, he wrote, or they may keep their current sentences in place but give them the opportunity for parole.

The case was brought by Henry Montgomery, a Louisiana inmate who challenged his sentence for the killing of an East Baton Rouge sheriff’s deputy in 1963, when Montgomery was 17 years old. Racial animosity at the time of his trial was so intense, including reported local cross burnings by the resurgent Ku Klux Klan, that the Louisiana Supreme Court voided his original death sentence.

A jury found him “guilty without capital punishment” upon retrial, thereby automatically sentencing him to life without parole. At the time, Louisiana’s procedures did not allow defendants like Montgomery to present mitigating evidence—in this case, his youth—before the sentence was handed down. Now 69 years old, Montgomery has spent his entire adult life behind bars.

In the intervening years, the Supreme Court chipped away at the use of society’s most severe punishments against defendants who were under the age of 18 when they committed a crime. The first hammerstroke came in 2005, when the justices struck down the death penalty for juvenile offenders in Roper v. Simmons. Writing for the majority, Justice Anthony Kennedy argued that society views children as less culpable for their actions than adult criminals, that they have the potential for rehabilitation, and that a “national consensus” had formed against their execution.

Drawing on Roper's reasoning, the Supreme Court then abolished life-without-parole sentences for juvenile offenders in non-homicide crimes in the 2010 case of Graham v. Florida. Terrance Graham had been sentenced to life imprisonment for armed robbery at age 16, and Florida’s abolition of parole meant he would serve the sentence until death. “The State has denied him any chance to later demonstrate that he is fit to rejoin society based solely on a nonhomicide crime that he committed while he was a child in the eyes of the law,” Kennedy wrote. “This the Eighth Amendment does not permit.”

The dissenting justices, for their part, complained that the majority had gone too far, breaching the barrier between the Court’s death-penalty rulings and the rest of the criminal-justice system. “For the first time in its history, the Court declares an entire class of offenders immune from a noncapital sentence using the categorical approach it previously reserved for death penalty cases alone,” Justice Clarence Thomas complained in dissent. “‘Death is different’ no more.”

After Graham, a juvenile offender could only receive a life-without-parole sentence for murder. But in some states, these sentences could be imposed on a mandatory basis, without weighing a defendant’s maturity, culpability, and potential for rehabilitation.

Such was the fate of Evan Miller and Kuntrell Jackson, two 14-year-olds with deeply troubled upbringings and histories of drug addiction and suicide. Miller and Jackson were each convicted of homicide during the course of separate armed robberies; Alabama and Arkansas respectively handed down automatic life-without-parole sentences to them. In 2012, the Court ruled in Miller v. Alabama that this also violated the Eighth Amendment.

The majority, led this time by Justice Elena Kagan, declined to forbid all juvenile life-without-parole sentences for homicide. Instead, she wrote, the system must distinguish between “unfortunate yet transient immaturity,” such as that demonstrated by the two defendants in the case, and “irreparable corruption.” The latter, she said, would likely be “uncommon.”

The Court’s decision in Miller meant mandatory life-without-parole sentences can’t be given to juvenile defendants now or in the future. But the obvious question arose: What about the more than 2,000 inmates already serving one?

Until the 1960s, the Supreme Court generally applied its constitutional rules retroactively to finalized cases. Only when the Warren Court launched its massive overhaul of the American criminal-justice system in the 1950s and 1960s did the justices attempt to limit their own rulings to ongoing and future cases. Constantly re-litigating past convictions and sentences whenever the Court tweaked a statute or procedure, the logic went, would be a ruinous burden for the legal system.

At the same time, allowing constitutionally erroneous sentences to stand could undermine the legitimacy of the criminal-justice system. My colleague Garrett Epps, in his coverage of Montgomery’s oral arguments, summarized the latter quandary well:

The question of “retroactivity” is an important battleground in criminal law. Say that you are in prison, convicted of a crime. You believe that some feature of your trial—the racial makeup of the jury and the selection process that produced it, say—violated the Constitution. You argued the issue in state court; when you lost there, you appealed your conviction to the state supreme court; when you lost there, you petitioned the Supreme Court for review. Without comment, the Supreme Court denied review. Your conviction and sentence are now final.

One morning you read that the Supreme Court has decided that this precise feature of the trial actually was a violation of the Constitution. Under this decision, you should clearly win.

What can you do? Your conviction has been upheld on appeal, and denied by the Court. This process—called “direct review”—is over and nothing can revive it.

Once this happens, a inmate's only hope for relief is through “collateral review,” this time in the federal courts. But the Supreme Court’s rulings, especially Teague v. Lane in 1989, limit how lower courts can provide retroactive relief when interpreting the Court’s new constitutional rules.

The crucial question is whether a new constitutional rule is substantive or procedural. Under the Court’s definitions, substantive rules—those governing who can be tried, of what crimes they can be convicted, or to what punishments they can be sentenced—are presumptively retroactive. Procedural rules, which affect the manner in which defendants are tried, are not.

Imagine setting rules for air travel—some substantive, and some procedural. The substantive rules who govern who could board a flight and where it could land; the procedural rules would address the routes it would take to get there. Only the changes to the boarding and landing rules would be presumptively retroactive; changes in flight routes would not be.

(The exception is if the Court pronounces a new “watershed” procedural rule that reshapes the “fundamental fairness” of American criminal law—something on the same order of magnitude as, say, requiring states to provide lawyers for poor defendants. But the Court has yet to hand down a “watershed” rule since theorizing about it, and it seems unlikely to do so in the future.)

For the Montgomery majority on Monday, Miller clearly created a substantive rule to be applied retroactively. “Because Miller determined that sentencing a child to life without parole is excessive for all but ‘the rare juvenile offender whose crime reflects irreparable corruption,’ it rendered life without parole an unconstitutional penalty for ‘a class of defendants because of their status’—that is, juvenile offenders whose crimes reflect the transient immaturity of youth,” Kennedy wrote. “As a result, Miller announced a substantive rule of constitutional law.”

Justice Antonin Scalia, who dissented alongside Justices Clarence Thomas and Samuel Alito, sharply disagreed. He began by challenging the jurisdictional grounds, arguing that Montgomery’s case was still in the state courts, not the federal courts, and therefore should be beyond the Court’s interference for now.

The majority disagreed. When a new substantive rule guides the outcome of a case, the Court ruled for the first time, state courts must also apply new substantive rules retroactively, not just lower federal courts. Since Miller’s rule emanated from the federal Constitution, the Louisiana Supreme Court’s refusal to apply it invited the U.S. Supreme Court’s intervention.

Scalia then turned to the substance. “Having distorted Teague, the majority simply proceeds to rewrite Miller,” he wrote, noting that the Court in Miller wrote that the ruling “does not categorically bar a penalty for a class of offenders or type of crime ... Instead, it mandates only that a sentencer follow a certain process.” This, he argues, indicates a procedural rule, not a substantive one.

Kennedy countered by citing the Court’s ban on executing people with intellectual disabilities, noting that inmates must still show evidence of their disability at a hearing. “Those procedural requirements do not, of course, transform substantive rules into procedural one,” he wrote for the Court. “The procedure Miller prescribes is no different.”

But Scalia sensed more at work. “This whole exercise, this whole distortion of Miller, is just a devious way of eliminating life without parole for juvenile offenders,” he replied. The majority cannot ban it outright, Scalia suggests, because Kennedy himself cited the punishment’s existence to justify abolishing the death penalty for juvenile offenders in Roper in 2005.

Now the majority’s only recourse, Scalia argues, is to make it impossible to carry out through these new hurdles. “And then, in Godfather fashion, the majority makes state legislatures an offer they can’t refuse: Avoid all the utterly impossible nonsense we have prescribed by simply ‘permitting juvenile homicide offenders to be considered for parole,’" he concludes. “Mission accomplished.”