DETROIT — The Supreme Court ruling that banned states from imposing mandatory life sentences on juveniles offers an unexpected chance at freedom to more than 2,000 inmates who had almost no hope they would ever get out.

In more than two dozen states, lawyers can now ask for new sentences. And judges will have discretion to look beyond the crime at other factors such as a prisoner's age at the time of the offense, the person's background and perhaps evidence that an inmate has changed while incarcerated.

"The sentence may still be the same," said Lawrence Wojcik, a Chicago lawyer who co-chairs the juvenile justice committee of the American Bar Association. "But even a sentence with a chance for parole gives hope."

Virtually all of the sentences in question are for murder. When Henry Hill was an illiterate 16-year-old, he was linked to a killing at a park in Saginaw County and convicted of aiding and abetting murder.

Hill had a gun, but he was never accused of firing the fatal shot. Nonetheless, the sentence was automatic: life without parole. He's spent the last 32 years in Michigan prisons.

"I was a 16-year-old with a mentality of a 9-year-old. I didn't understand what life without parole even meant," Hill, now 48, said Tuesday in a phone interview.

He heard about the Supreme Court decision while watching TV news in his cell.

"I got up hollering and rejoicing and praising God," said Hill, who would like to renovate homes and be a mentor to children if he's released. "The last three or four years, they always put young guys in with me."

The ruling also alarmed families of crime victims. Jessica Cooper, prosecutor in Oakland County, Mich., said her office has been taking calls from "distressed" relatives.

"Now they're going to start all over," Cooper said. "It's going to take years."