An Alabama man who has served 36 years in prison for stealing $50.75 from a bakery will now finally walk free after a judge re-sentenced him.

Alvin Kennard, 58, was originally sentenced to life in prison without the possibility of parole back in 1983 for first-degree robbery.

After more than three decades behind bars, Kennard was ordered to be released on Wednesday and is set to now be processed out by the Alabama Department of Corrections.

His unusually harsh punishment for theft in 1983 was due to Alabama's old 'three strikes law', also known as the Habitual Felony Offender Act.

Alvin Kennard, 58, was originally sentenced to life in prison without the possibility of parole back in 1983 for first-degree robbery. Kennard was ordered to be released on Wednesday after a judge re-sentenced him

Kennard has been in prison since 1984 when he was 22 after he robbed a bakery at knife point. He was originally sentenced to life in prison with parole until a judge re-sentenced him this week to time already served

At the time he was jailed, Kennard had previously been charged with burglary and grand larceny - making him eligible to be sentenced under the act.

If he had been sentenced today for the same crime, Kennard would have received a minimum of 10 years and a maximum of life in prison with the possibility of parole. Under that sentencing, Kennard would have been eligible for parole in 1999.

'I'm sorry for what I did... I was wrong. I take responsibility for what I did in the past. I want the opportunity to get it right,' Kennard told the judge just moment before being re-sentenced, according to WBRC.

His family cheered in court when the judge cut his time short and re-sentenced him to time already served.

Kennard, who has spent much of his adult life at the William E. Donaldson Correctional Facility in Bessemer, now plans to live with his family and work in carpentry.

His re-sentencing came after Alabama tweaked its sentencing guidelines in 2013 due to overcrowding in the state's prison system.

The newly created Alabama Sentencing Commission was designed to give judges more discretion in cases like that of Kennard.

His family cheered in court when the judge cut his time short and re-sentenced him to time already served

Kennard, who has spent much of his adult life at the William E. Donaldson Correctional Facility in Bessemer, now plans to live with his family and work in carpentry

HOW A $50 ROBBERY LANDED A MAN BEHIND BARS FOR LIFE Alabama's old 'three strikes law', also known as the Habitual Felony Offender Act, was set up in the 1970s to crack down on repeat offenders. Alvin Kennard was first arrested when he was 18 and pleaded guilty in 1979 to burglary, grand larceny and receiving stolen property. He was given three years probation. When he was sentenced in 1984 over the bakery robbery when he was 22, his prior convictions were taken into account. It made him eligible to be sentenced under the act and a mandatory life sentence without parole was enforced. If he had been sentenced today for the same crime, Kennard would have received a minimum of 10 years and a maximum of life in prison with the possibility of parole. He would have been eligible for parole in 1999. Advertisement

When he was arrested for the bakery robbery at the age of 22, Kennard already had a brief criminal history.

At the age of 18, he was charged with burglary, grand larceny and receiving stolen property following a break-in at an unoccupied service station.

He pleaded guilty to that crime in 1979 and was given three years probation.

Those prior convictions were taken into account several years later when he was sentenced for robbing the bakery at knife point.

As a result of him pleading guilty to three felony counts in the earlier crimes, Kennard was given a mandatory life sentence without parole due to the Habitual Felony Offender Act.

The act was set up in the 1970s to crack down on repeat offenders.

Kennard's family have not commented since the judge's decision but they were notably excited about his pending release.

His niece Patricia Jones told CBS42 that she had been visiting him for years in prison and she could see how much he had changed for the better.

'It was a couple of years that he started talking about God and I knew he had changed,' Jones said.

'He wants to be forgiven for what he had done and he wants the opportunity to come back and learn how to survive.'

She said God was showing his 'higher power' by allowing Kennard's release.