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 ruling cements California's status as the first state to take the step, said The Sentencing Project, an advocacy group.

The 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.

"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.

FILE - In this Jan. 7, 2020, file photo, is the Earl Warren Building, headquarters of the Supreme Court of California, in San Francisco. The California Supreme Court on Thursday, Feb. 25, 2021, 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 like murder, arson and robbery, rape or kidnapping. (AP Photo/Jeff Chiu, File)

FILE - In this Jan. 7, 2020, file photo, is the Earl Warren Building, headquarters of the Supreme Court of California, in San Francisco. The California Supreme Court on Thursday, Feb. 25, 2021, 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 like murder, arson and robbery, rape or kidnapping. (AP Photo/Jeff Chiu, File)

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 state Constitution says such ballot measures can't be changed by the Legislature, only by another statewide vote.

Proponents including state 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 save youths from 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 release would endanger public safety.

CALIFORNIA MAN ALLEGEDLY TRIED BURYING WIFE ALIVE DURING BEACH ATTACK FOLLOWING ARGUMENT, POLICE SAY

"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.

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

"The state will now be required to mandate that they release some of the most violent juvenile criminals in the country," said Kymberlee Stapleton, an attorney with the Criminal Justice Legal Foundation, a victim advocacy group.

Offenders previously convicted as adults can now contend they are entitled to new trials in juvenile court, she said. And she said ballot initiatives seemingly may now be altered by state lawmakers "based upon a subjective view of ‘voter intent."

TEEN LAMBORGHINI DRIVER WAS SPEEDING DURING LA WRECK THAT KILLED WOMAN, FAMILY CLAIMS: REPORT

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.

"ALL children are redeemable. Today the Supreme Court upheld that principle and took another huge step toward fairness in our juvenile justice system," said state Insurance Commissioner Ricardo Lara, who 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.

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.

CLICK HERE TO GET THE FOX NEWS APP

"Children should not be treated as adults because they possess unique tendencies, such as impulsiveness, susceptibility to peer influence and inability to foresee the long-term consequences of their actions," Gascón said in a statement. "We know from science that young people have the capacity for growth and development that increases their likelihood of rehabilitation."