A man who spent more than three decades in an Alabama prison -- a $50 robbery in 1983 triggered a life sentence -- will soon be free, according to media reports.

Circuit Judge David Carpenter on Wednesday resentenced Alvin Kennard, 58, to time served, Fox 6 reported.

Kennard has spent the past 36 years in the William E. Donaldson Correctional Facility in Bessemer. He was sentenced to life without parole for a Jan. 24, 1983, bakery robbery.

Kennard, then 22, was sentenced under the state's Habitual Felony Offender Act. He had a previous second-degree burglary conviction to his name, which led to his life sentence, AL.com reported.

“I just want to say I’m sorry for what I did,” Kennard said before Carpenter announced his ruling. “I take responsibility for what I did in the past. I want the opportunity to get it right.”

Kennard's attorney, Carla Crowder, the executive director of the Alabama Appleseed Center for Law and Justice, argued her client would have received 20 years under the state's current sentencing guidelines.

CLICK HERE TO GET THE FOX NEWS APP

She said told the news station she was not sure when Kennard would be released. He has to be processed out of the Alabama Department of Corrections, she said.