SANTA CRUZ (AP) — A 21-year-old California man who pleaded guilty to the murder of a neighbor girl in 2015 was sentenced as a juvenile Tuesday and could be released in as early as four years.

Adrian Gonzalez entered the plea on April 13 in Santa Cruz as soon as the case was transferred to juvenile court, the Santa Cruz Sentinel reported.

READ MORE: 1 Dead, 2 Injured In Separate Falls During Phish Concert At Chase Center

Gonzalez was 15 at the time 8-year-old Madyson “Maddy” Middleton was killed.

Santa Cruz County Superior Court Judge John Salazar said he had no choice but to remove the case from the adult court system because of juvenile justice reforms, the Sentinel reported.

In adult court, Gonzalez could have faced two consecutive life prison sentences for murder, kidnapping, sexual penetration, two counts of lewd and lascivious behavior and intercourse with a minor, plus misdemeanor destruction of evidence.

According to the court records, Middleton followed the teen home after he promised her ice cream. Then he bound, choked, stabbed and attempted to rape her.

READ MORE: Parents Rally Statewide To Protest Newsom's School COVID Vaccination Mandate

In the juvenile system, Gonzalez will be eligible for release at age 25.

In 2017, Salazar found Gonzalez — then 18 — fit to be tried as an adult.

Then, state lawmakers in 2018 passed Senate Bill 1391, amending Prop 57 to bar courts from allowing minors younger than the age of 16 to be tried as adults. After subsequent legal challenges, the State Supreme Court upheld SB 1391’s constitutionality in a February ruling, clearing the way for Gonzalez’s case to proceed this month.

The state plans to stop admissions to youth facilities before July as it moves to end the program by 2023, the Sentinel reported.

MORE NEWS: Dog Rescued From Union City Apartment Fire

© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.