LOS ANGELES (AP) — Edel Gonzalez has been a model prisoner since being sentenced to life in prison for his role in a fatal attempted carjacking when he was a teen, his lawyers say.

For more than two decades, he stayed out of trouble behind bars, renounced his gang affiliations and participated in nearly every school and rehabilitation program offered.

He did all that with no hope of ever being free and thought the only way he would leave prison would be in a coffin.

But that could change after Gonzalez became the first inmate under a new California law to have his life sentence reduced for a crime committed as a juvenile. Under the law, inmates sentenced when they were minors can ask judges to reconsider their terms after they serve at least 15 years in prison, making them eligible for parole.

Last week, a judge in Orange County resentenced Gonzalez, now 38, to 25 years to-life. It's unclear when Gonzalez will go before a parole board to hear his case, but his sister said Wednesday that he has worked hard to become a better person.

"He said he was in shock. He wasn't sure it was happening," Lydia Oregel said of her brother's reaction to the judge's decision. "It's just a blessing, it really is."

California has more than 300 inmates serving life-without-parole sentences for crimes committed when they were minors. Of those, about 120 are currently eligible for resentencing consideration because they served the minimum 15 year-term, prison officials said.

Supporters of the new law contend those who commit crimes as juveniles should be given a second chance because their brains are still developing and they are more vulnerable than adults. But opponents, who included victim rights groups and some organizations representing law enforcement, countered that the possibility of future parole hearings would subject survivors to relive the experience.

At the resentencing hearing last week, Gonzalez expressed remorse for his role in the crime.

"There isn't a day that goes by when I'm not reminded of the wrong, the harm and the pain I've caused," he said. "If given the opportunity, I hope one day to help young kids stay away from gangs and their lies — kids that think there's no way out, as I did in my youth."

The sentence reduction came at a good time for Gonzalez, who has served 22 years in prison. The new law doesn't allow such a change for those who have been in custody for more than 25 years, said Elizabeth Calvin of the advocacy group Human Rights Watch.

"I think Edel Gonzalez is exactly the kind of person that this law contemplated," Calvin said. "We are happy to see that California has now in place a thoughtful, careful system for reviewing the sentences of people who were children at the time of their crimes."

Gonzalez, then 16, was convicted of first-degree murder for the slaying of Janet Bicknell in August 1991. At the time, he was the youngest person in Orange County's history to receive that punishment.

He and a number of adult gang members tried to carjack Bicknell, who had refused to give her car to her assailants. Gonzalez wasn't the shooter and wasn't carrying a weapon but was given the same sentence as the gunman and sentenced to the maximum prison term allowed under the law, his attorneys said.

California is among 39 states that allow judges to sentence minors to life in prison. The U.S. Supreme Court last year deemed such sentences for juveniles as unconstitutional, citing the terms as cruel and unusual punishment. The ruling, however, didn't affect California's law because it already gives judges the discretion to impose a sentence of 25 years-to-life.

"Young people often make mistakes, and sometimes those mistakes have terrible consequences," said state Sen. Leland Yee, D-San Francisco, who authored the legislation. "But we cannot write any child off for the rest of their lives. We must at least give them the chance to atone and seek forgiveness for what they've done."