A booking photo for Lee Boyd Malvo, then 18, during his murder trial in Chesapeake, Va., in 2003. (City of Chesapeake Sheriff’s Office)

Convicted sniper Lee Boyd Malvo’s six life sentences, for the six Montgomery County, Md., slayings he committed as a 17-year-old in 2002, were allowed to stand Wednesday after a Montgomery judge found that Malvo was not given mandatory life terms, which the U.S. Supreme Court has ruled are unconstitutional for juveniles.

Malvo, now 32, could still have the sentences overturned by a federal court in Maryland, which is also considering his appeal. In Virginia, life sentences for his jury conviction in one murder case and his guilty pleas to two other murders were overturned in May by a federal judge because of the Supreme Court’s ruling. Virginia is appealing the order that Malvo must be resentenced in those three cases.

Malvo and John Allen Muhammad began a cross-country shooting rampage in Washington state in February 2002 and concluded with a series of 13 shootings, 10 of them fatal, in the D.C. area in October of that year. Malvo was tried first for a fatal shooting in Falls Church, Va., and a jury in Chesapeake, Va., convicted him but chose a life sentence without parole rather than a death sentence. Muhammad was tried for a slaying in Manassas, Va., and a jury in Virginia Beach convicted him and sentenced him to death. Malvo then pleaded guilty to two more slayings near Fredericksburg, Va., and received two more life sentences.

Having already been convicted of three slayings in Virginia, Malvo in 2006 testified against Muhammad in his trial in Montgomery County and then pleaded guilty to six counts of first-degree murder. Montgomery Circuit Court Judge James L. Ryan then imposed six more consecutive life sentences on Malvo.

Malvo expressed remorse and asked for forgiveness at his sentencing in November 2006, but Ryan told him, “Forgiveness is between you and your God, and personally, between you and your victims, and the families of your victims. This community, represented by its people and the laws, does not forgive you.”

But in 2012, the Supreme Court ruled that “sentencing a child to life without parole is excessive for all but ‘the rare juvenile offender whose crime reflects irreparable corruption.’ ” Malvo’s attorneys requested a resentencing and were successful in Virginia.

Judge Ryan has since retired. But Judge Robert A. Greenberg issued a 20-page ruling Tuesday, released publicly on Wednesday, that concluded that “Judge Ryan is presumed to have known the law,” and that Malvo was not facing mandatory life-without-parole sentences when he was sentenced. “Clearly, Maryland employs a discretionary sentencing scheme,” Greenberg wrote, noting that Ryan had a range of options from a suspended sentence to life without parole. “Judge Ryan would have been well aware that a juvenile (albeit one four months from majority) ought to be beyond rehabilitation before life-without-parole could be imposed … the court expressly considered Defendant’s youth in sentencing him. ”

But even if Malvo’s sentences were mandatory, Greenberg ruled, “Judge Ryan affirmatively considered all the relevant factors at play,” to include extensive biographical and psychological reports on Malvo, “and the plain import of his words at the time of sentencing was that Defendant is ‘irreparably corrupted.’ ”

Ryan’s ruling does not affect Malvo’s appeal of his sentences in the federal court in Maryland or his Virginia cases.

James Johnston, one of Malvo’s Maryland lawyers, said that “we are reviewing the decision and considering potential next steps.”

Montgomery County State’s Attorney John McCarthy said Ryan considered the fact that Malvo had testified against Muhammad and other mitigating evidence, as the Supreme Court would declare was necessary six years later, and that “the heinous nature of the case and the number of victims is what made this the appropriate sentence.” He said he was pleased with Greenberg’s ruling “and we think the way it was crafted protects us in any further state appellate review.”

Here is Greenberg’s opinion:

This post has been updated with comments from the lawyers in the case.