A man who had been imprisoned in Oklahoma for almost 50 years for a fatal shooting that he has long claimed he didn’t commit has been freed from custody after a judge ordered a new trial.

Glynn Ray Simmons had been convicted in the 1974 death during a robbery of Carolyn Sue Rogers, a liquor store clerk in Edmond, located just north of Oklahoma City.

A woman who was shot and injured during the robbery later picked Simmons out of a lineup. But Simmons, from Louisiana, has repeatedly said he wasn’t in Oklahoma but in his home state at the time of the robbery.

OKLAHOMA TRIPLE MURDER-SUICIDE: MOM, 39, KILLS 10-MONTH-OLD BABY BOY, 6-YEAR-OLD SON AND 11-YEAR-OLD DAUGHTER

The Oklahoma County District Attorney‘s office had asked District Judge Amy Palumbo to vacate the sentence and set a date for a new trial, saying prosecutors had failed to turn over evidence in the case, including a police report that showed an eyewitness might have identified other suspects in the case and not Simmons and a co-defendant, Don Roberts.

Oklahoma Fox News graphic

Glynn Ray Simmons, a man who was imprisoned for nearly 50 years, was released from prison after a judge ordered a new trial.

During a court hearing on Wednesday, Palumbo vacated Simmons’ murder conviction and life sentence, saying he was entitled to relief "for the state’s failure to disclose police department reports which denied Glynn Simmons a fair trial."

Simmons was 22 when he was convicted. He is now 70 years old.

OKLAHOMA MOTHER AND 3 CHILDREN DEAD AFTER HOURSLONG STANDOFF, POLICE SAY

"I’m free now," Simmons told KFOR as he walked out of the courtroom on Wednesday. "It’s indescribable. I did 48 years. Justice is out the window. This is mercy. I’m happy. I’m ready to move on and make something of my life."

A jury had originally sentenced Simmons and Roberts to death. Their sentences were reduced to life in prison in 1977 after U.S. Supreme Court rulings related to capital punishment.

CLICK HERE TO GET THE FOX NEWS APP

Roberts was released on parole in 2008 and testified at an April hearing that he was innocent, the Oklahoman reported.

Oklahoma County District Attorney Vicki Behenna said the next step will be to evaluate the case for retrial, which was set for Oct. 23.