ANNAPOLIS, Md. (AP) — Maryland's highest court has upheld life sentences for juveniles.

The Court of Appeals ruled 4-3 that Maryland law provides a juvenile offender serving a life sentence with a "meaningful opportunity" to obtain release based on demonstrated maturity and rehabilitation. In its ruling Wednesday, the court cited state law, parole commission regulations and an executive order by Gov. Larry Hogan.

Maryland's parole commission makes recommendations about parole, but the governor has the final decision — a feature that distinguishes Maryland's parole system from most other states.

The ruling doesn't prevent individual inmates from suing the state for failing to provide the meaningful opportunity required under the Eighth Amendment's prohibition on cruel and unusual punishment.

The court upheld the life sentences of Daniel Carter, who committed first-degree murder in 1998 when he was 15, and James Bowie, who committed attempted first-degree murder and robbery in 1995 at age 17.

The court found Hogan's executive order is of particular significance, because it "attempts to bridge the gap between unfettered discretion that the legislature has given to the governor with respect to parole of inmates serving life sentences and the requirements of the Eighth Amendment as to juvenile offenders."

"The 2018 Executive Order does not attempt to broaden that discretion, but rather to cabin it consistent with constitutional requirements recognized after the passage of that statute," Judge Robert McDonald wrote for the majority.

In a dissenting opinion, Chief Judge Mary Ellen Barbara wrote that the majority opinion applies U.S. Supreme Court cases to Maryland's process "in an aspirational rather than a realistic manner." She wrote that she isn't persuaded that the executive order or state law "cures the constitutional infirmity of Maryland's current parole system."

"I come to that conclusion because neither the Executive Order nor the regulation includes any sort of standard to guide the exercise of discretion, much less a standard that satisfies the Eighth Amendment," Barbara wrote.

Separately, the court ruled that a sentence of 100 years for a juvenile for a single crime is unconstitutional given that it prevents the offender from being eligible for parole for 50 years. Such a sentence "is tantamount to a sentence of life without parole," and is precluded by the Eighth Amendment as interpreted by the U.S. Supreme Court, the ruling said.

The Maryland Court of Appeals ruled that Matthew McCullough, who received a 100-year sentence after being convicted of four counts of first-degree assault committed when he was 17, "must be resentenced."