On Monday, the Supreme Court added to a series of rulings that in the past decade have defined what constitutes “cruel and unusual punishment” for juvenile offenders. It violates the Eighth Amendment, the court ruled, to impose a mandatory life sentence without parole for crimes, including homicide, committed when the offenders were younger than 18 years. The ruling strikes down federal and state laws that require judges automatically to put teenage criminals in prison and, in effect, throw away the key.

A close 5-4 vote, this week’s decision follows another in 2010 that declared it unconstitutional to impose a life sentence without parole on juveniles involved in crimes that did not result in a death. Earlier decisions in 2002 and 2005 struck down the death penalty for prisoners with mental retardation and for juveniles.

As in earlier rulings, the court stressed the obligation in the criminal justice system to take into account developmental differences that make it cruel and unfair to treat juvenile offenders in the same way as adult criminals. The court’s opinion, written by Justice Elena Kagan, noted the adolescent limitations: the immaturity, the impetuous behavior, the failure to appreciate risks and consequences. “Mandatory life without parole for a juvenile,” the court concluded, “precludes consideration of his chronological age and its hallmark features. ... It prevents taking into account the family and home environment that surrounds him — and from which he cannot usually extricate himself — no matter how brutal or dysfunctional.”

The court majority recognizes correctly that appropriate punishment in juvenile cases must factor in not only the “hallmark features” but also the likelihood that change and rehabilitation will come with maturity. Taking away the option of parole automatically makes no allowance for the possibility of change.

Still, the decision does not offer young criminals a pass from a life sentence without parole. It leaves room for individual judges to exercise discretion case by case, to consider the specific characteristics and circumstances of juveniles who commit horrendous crimes and to decide when a sentence of life without parole may be appropriate and just punishment. In this and earlier decisions, the court sets a worthy standard of decency that reflects the progress of a maturing society.