A man works to clear snow on Jan. 24 in front of the Supreme Court . (Joshua Roberts/Reuters)

The Supreme Court ruled Monday that those sentenced as teenagers to mandatory life imprisonment for murder must have a chance to argue that they should be released from prison.

The ruling expanded the court’s 2012 decision that struck down mandatory life terms without parole for juveniles and said it must be applied retroactively to what juvenile advocates estimate are 1,200 to 1,500 cases.

More than 1,100 inmates are concentrated in three states — Pennsylvania, Louisiana and Michigan — where officials had decided the 2012 ruling was not retroactive.

They should have a chance to be resentenced or argue for parole, said Justice Anthony M. Kennedy, who wrote the new 6-to-3 decision.

Kennedy has been the court’s champion in a line of cases that declare that juveniles convicted of even the most heinous crimes must be treated differently than adults. The court in 2005 ruled out capital punishment for juveniles and later said they could not be locked away for life for crimes other than murder.

The 2012 case ruled out mandatory life imprisonment without parole, which was the situation facing Henry Montgomery of Louisiana, who brought Monday’s case. In 1963, when he was 17, Montgomery shot and killed Charles Hurt, a sheriff’s deputy.

Montgomery is now 69 and says his rehabilitation in prison should make him eligible to be considered for parole. The Louisiana Supreme Court rejected his plea, saying the U.S. Supreme Court’s 2012 ruling in Miller v. Alabama was not retroactive.

The six-member majority, which in addition to Kennedy included Chief Justice John G. Roberts Jr. and the court’s liberals, said on Monday that it was.

“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,” Kennedy wrote.

Kennedy acknowledged that the court’s 2012 Miller decision recognized that a judge “might encounter the rare juvenile offender who exhibits such irretrievable depravity that rehabilitation is impossible and life without parole is justified.”

But he said the ruling’s overarching lesson was that “children’s diminished culpability and heightened capacity for change” cast doubt on mandatory sentences, and that this “harshest possible penalty will be uncommon.”

In a dissent that described Kennedy’s ruling as “astonishing” and “sleight of hand,” Justice Antonin Scalia said the majority’s goal was abolishing life imprisonment without parole for juveniles.

There are two pending cases asking the court to do that. And Christopher Slobogin, a juvenile-justice expert at Vanderbilt Law School, wondered what the next step might be for a court majority that thinks the immaturity and impetuous behavior of juveniles, as well as their potential for reform, makes them different from adults.

“The next step might be no mandatory sentences for children at all,” he said.

Many states that previously allowed life imprisonment without parole for juvenile offenders had already agreed that those sentenced under the old codes could have their sentences reviewed. Others, such as Arkansas and Texas, have enacted mandatory sentences — 40 years, for instance — before parole can be considered.

But seven, including Louisiana, had said the court’s ruling was not retroactive. Most changes in criminal law do not apply to settled cases.

But Kennedy said the Miller ruling was a substantive change in the law that must be applied to earlier sentences.

“A penalty imposed pursuant to an unconstitutional law is no less void because the prisoner’s sentence became final before the law was held unconstitutional,” Kennedy wrote. “There is no grandfather clause that permits states to enforce punishments the Constitution forbids.”

Scalia retorted: “There most certainly is a grandfather clause — one we have called finality — which says that the Constitution does not require states to revise punishments that were lawful when they were imposed.”

Kennedy acknowledged the difficulty of determining decades later whether a judge was correct to have justified sentencing a youth to life imprisonment because of “irretrievable depravity.”

But he said the situation could be remedied by giving the offender a parole hearing.

“Those prisoners who have shown an inability to reform will continue to serve life sentences,” Kennedy wrote. “The opportunity for release will be afforded to those who demonstrate the truth of Miller’s central intuition — that children who commit even heinous crimes are capable of change.”

Scalia said that was a power play that showed the majority’s true goal of getting rid of life imprisonment for juveniles.

“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,’ ” Scalia wrote. “Mission accomplished.”

Scalia was joined in dissent by Justices Clarence Thomas and Samuel A. Alito Jr.

Kennedy said Montgomery will still have to prove his case but that he had a good case to make.

“Henry Montgomery has spent each day of the past 46 years knowing he was condemned to die in prison,” Kennedy wrote, but added that Montgomery “has discussed in his submissions to this court his evolution from a troubled, misguided youth to a model member of the prison community.”

Those inmates affected by the court’s decision will probably have to bring individual claims or requests for parole, juvenile-justice experts said.

Marsha Levick of the Juvenile Law Center said there could be special proceedings to deal with those inmates. For instance, of about 500 serving life sentences without parole in Pennsylvania, she said, about 300 are from one county, Philadelphia.

The Supreme Court’s decisions on juvenile sentencing have featured sharp debates between Kennedy and Scalia, and Monday’s was no different.

“This whole exercise,” Scalia wrote, “is just a devious way of eliminating life without parole for juvenile offenders. But, without mentioning Kennedy by name, Scalia said such a straightforward acknowledgment would have been “an embarrassment.”

One of the justifications the court gave in Roper v. Simmons for ending the death penalty for juvenile murderers was that life without parole was a severe enough punishment, Scalia said.

“How could the majority — in an opinion written by the very author of Roper — now say that punishment is also unconstitutional?” Scalia asked. Since it couldn’t, he answered, they made it “a practical impossibility.”

The case is Montgomery v. Louisiana.