A man on death row in Pennsylvania is about to get his first taste of freedom in 30 years.

The district attorney dropped all charges against Daniel Gwynn, citing bad and corrupt police work in his case.

Gwynn was accused of starting a fire at an abandoned building in west Philadelphia that killed Marsha Smith.

According to the DA, the prosecution in Gwynn’s case relied on witness testimony, who told police that he had started the fire.

Authorities say the police told the prosecutor at the time that the witnesses picked Gwynn out of a photo lineup.

However, the photo lineup was never admitted as evidence during Gwynn’s trial, and, in fact, Gwynn’s photo was never in the lineup that was shown to witnesses.

Investigators say it turned out that Gwynn gave a confession that was not factually consistent with how the fire started.

"It was a key part of my survival in there because there was one way to, you know, speak about the injustice that was happening to me. And also the pain that I was feeling. And luckily I had good lawyers, you know, on my side, I'm going to go home and have a good meal with my family. No prison food," Gwynn told reporters.

The DA believes he was terrified and told police what they wanted to hear.

Officials say all of this leads them to believe that Gwynn is more than likely not the person who killed Marsha Smith.

“It's mostly for us a day of tremendous relief and sadness that a guy like him, an innocent soul, would have spent that amount of time waiting for his execution and then languishing in prison," Gwynn's attorney said.

The DA's office points out that Gwynn’s conviction likely allowed the real perpetrator to escape.

ncG1vNJzZmivmpawtcKNnKamZ56axLR7y6iamqRfpa5usMSaq6FloqTEbrXNppitnV2axbC6xKuYrZ2UYq6nwMSrZGxoXa6yor7SZpmeoJmjsW6uwKuq