Anthony Ray Hinton, 58, spent half his life on Alabama’s death row, sentenced to die for two 1985 murders that for decades he insisted he did not commit.

Over 28 years, the outside world changed while Hinton spent his days largely in a 5ft by 8ft prison cell. Children grew up. His mother died. His hair turned gray. Inmates he knew were escorted off to the electric chair or the lethal-injection gurney.

He was set free on Friday after new ballistics tests contradicted the only evidence – an analysis of crime-scene bullets – that connected Hinton to the slayings.

As he left the jail, Hinton said he would pray for the victims’ families as he has done for the past 30 years. They have suffered a “miscarriage of justice” as well, he said. He had less kind words for those involved in his conviction.

“When you think you are high and mighty and you are above the law, you don’t have to answer to nobody. But I got news for them, everybody who played a part in sending me to death row, you will answer to God,” Hinton said.

According to the Death Penalty Information Center, Hinton is the 152nd person exonerated from death row since 1973 and the sixth in Alabama.

“They had every intention of executing me for something I didn’t do,” Hinton said outside the Jefferson County jail in Birmingham.

Friends and family members rushed to embrace Hinton after his lawyers escorted him outside of the jail on Good Friday morning. His sisters wiped tears, saying “Thank you, Lord,” as they wrapped their arms around their brother.

Equal Justice Initiative director Bryan Stevenson, who waged a 16-year fight for Hinton’s release, said while the day was joyous, the case was tragic.

“Not only did he lose his life, he lived a life in solitary confinement on death row, condemned in a five-by-eight cell where the state was trying to kill him every day,” Stevenson said.

Hinton was convicted of killing two fast-food restaurant workers – John Davidson and Thomas Wayne Vason – during separate 1985 robberies at Mrs Winner’s and Captain D’s restaurants in Birmingham. Investigators became interested in him after a survivor at a third restaurant robbery picked Hinton out of a photo lineup.

The only evidence linking him to the slayings were bullets that state experts then said had markings that matched a .38-caliber revolver that belonged to Hinton’s mother. There were no fingerprints or eyewitness testimony.

Stevenson said a defense analysis during appeal showed that bullets did not match the gun. He then tried in vain for years to persuade the state of Alabama to re-examine the evidence.

A breakthrough came last year when he won a new trial after the US supreme court ruled Hinton’s trial counsel “constitutionally deficient”. His defense lawyer wrongly thought he had only $1,000 to hire a ballistics expert to rebut the state’s case. The only expert willing to take the job at that price – a one-eyed civil engineer with little ballistics training who admitted he had trouble operating the microscope – was obliterated on cross-examination.

The Jefferson County district attorney’s office on Wednesday moved to drop the case after their forensics experts were unable to match crime-scene bullets to the gun.

Stevenson called Hinton’s conviction a “case study” in what is wrong with the American justice system.

“We have a system that treats you better if you are rich and guilty than if you are poor and innocent and this case proves it. We have a system that is compromised by racial bias and this case proves it. We have a system that doesn’t do the right thing when the right thing is apparent,” Stevenson said.

“Prosecutors should have done this testing years ago.”

The Alabama attorney general’s office declined to comment.

Chief deputy district attorney John R Bowers Jr said three experts with the Alabama Department of Forensic Sciences examined the bullets ahead of the anticipated retrial in the case.

Bowers said all three reached the same conclusion: they couldn’t conclusively determine whether or not any of those bullets were fired from the revolver taken from Hinton’s home, or even if they had been fired from the same gun.

Hinton planned to put flowers on his mother’s grave. After that comes the adjustment to the modern world after spending nearly half of his life in solitary confinement.

“The world is a very different place than what it was 30 years ago,” Stevenson said. “There was no Internet. There was no email. I gave him an iPhone this morning. He’s completely mystified by that.”