A Black man was found innocent on Wednesday after spending nearly two decades in prison for a murder he did not commit, The Star-Telegram reports.

John Earl Nolley received an apology from State District Judge Louis Sturns for the 19 years he spent in prison after he was accused of murdering a friend of his.

In addition to his time spent behind bars, Nolley, who was released in 2016, has spent two years waiting for his name to be officially cleared.

“I have signed the order dismissing your case,” Sturns said. “I want to apologize for what happened to you. I realize that cannot take back 21 years, but to the extent that words can express our sorrow, I apologize for what happened.”

Two jailhouse informants falsely testified that Nolley, 44, killed Sharon McLane on Dec. 14, 1996. McLane was found in her apartment stabbed 57 times and Nolley was sentenced to life in prison in 1998, writes the Star-Telegram.

The Innocence Project, the non-profit organization that helps exonerate people who are wrongly convicted, and the Conviction Integrity Unit, which looks at old cases to make sure that innocent people are not in prison for crimes they did not commit, worked together to help free Nolley.

The organizations worked with the Bedford Police Department and interviewed over 70 witnesses and re-tested evidence to clear Nolley’s name, per reports.

“I got to give honor to God,” said Nolley. “There’s no other way I could be here. In my right mind, having gone through all that. I thank the district attorney and the Bedford police department and the system as a whole. We don’t always make the right decisions. But Sharen Wilson did the honorable thing in this situation. I thank you a lot.”

Stemming from Nolley’s case, a state law was passed in 2017 that regulated how jailhouse informants were used, according to the Star-Telegram.

Since his release from prison, Nolley got married and had a son. He is eligible to receive payments from a state fund that would give him $80,000 a year for every year he was wrongfully incarcerated.