SACRAMENTO, Calif. (AP/CBS13) — The California Supreme Court on Thursday upheld the state’s 2018 law barring 14- and 15-year-olds from being tried as adults and sent to adult prisons even for serious crimes such as murder, arson, robbery, rape or kidnapping.

The state high court found the law did not conflict with Proposition 57, approved by voters two years earlier, that allowed judges to decide whether young suspects should be tried in adult court.

READ MORE: 2 Drivers Killed In Head-On Crash Near Patterson

“The amendment is fully consistent with and furthers Proposition 57’s fundamental purposes of promoting rehabilitation of youthful offenders and reducing the prison population,” Associate Justice Joshua Groban wrote in the unanimous decision.

Five lower appellate courts previously found that there was no conflict, but a sixth appellate panel ruled in 2019 that SB1391 was superseded by the ballot measure and therefore was unconstitutional.

Opponents of the law argued that the California Constitution says such ballot measures can’t be changed by the Legislature, only by another statewide vote.

Proponents including California Attorney General Xavier Becerra countered that the law furthers the intent of the ballot measure and therefore is valid. The ballot measure took decisions on whether to try youths as adults away from district attorneys and gave that power to judges.

The ruling will prevent youths from receiving much stiffer penalties that can be imposed in adult court. Youths convicted in juvenile courts can generally be incarcerated only until they reach 25. There is an exception that allows prosecutors to ask judges to hold offenders longer if their release would endanger public safety.

READ MORE: Detectives: Rental Fraud Suspect Posted Turlock Properties On Facebook Marketplace, Scammed People Out Of $2,000

“Nothing in Proposition 57 appears to forbid the Legislature from making a judgment that public safety can be better protected by keeping the subset of particularly young, 14- and 15-year-old offenders in the juvenile system where they are more likely to receive appropriate education and emotional and psychological treatment, and less likely to reoffend after their release,” Groban wrote.

Groban said the move also feeds the goals of reducing prison crowding and saving money that would otherwise be spent on incarceration.

The case, known by the then-15-year-old suspect’s initials, “O.G.”, involves a purported Ventura County gang member charged with fatally shooting Jose Lopez, 22, and within a month fatally stabbing Adrian “Mikey” Ornelas, 26, in 2018.

State Insurance Commissioner Ricardo Lara authored the law when he was in the state Senate.

It’s the second time in two months that the high court has weighed in on the ballot measure championed by former Gov. Jerry Brown, who also signed the Lara bill into law. In December it held that the four-year-old initiative allowed earlier parole consideration for nonviolent sex offenders, contrary to what Brown had repeatedly told voters.

MORE NEWS: California-Grown Cannabis To Be Judged At Next State Fair

The case also plays into Los Angeles County District Attorney George Gascón’s efforts to chart a different course. He has pledged to stop trying juveniles as adults in the county, and withdrew a friend-of-the-court brief his predecessor had filed siding with opponents of the prosecution limits.