MINEOLA, N.Y. (CBSNewYork) — A man who spent more than 20 years behind bars for murder was free on Friday.

The Nassau County DA asked that his case be vacated after discovering an error in the original prosecution.

Joseph Jackson, 47, walked out of the very courthouse where two decades ago he was convicted on a murder he claims he didn’t commit.

After 23 years behind bars, a judge had his shackles removed and granted him freedom.

“Kinda hard having our freedom snatched away from you and then given back to you by the grace of God. I’ve been telling them I was innocent all along, but I couldn’t find an ear to believe me except my attorney,” Jackson said. 

The same attorney who stood by him at trial called this a bittersweet day.

“It damages the heart to know someone went through this when there was info at the time which would have led to his acquittal,” defense attorney Scott Brettschneider said.

Jackson was charged in the 1994 murder of 19-year-old Steven Jason who was shot to death leaving a birthday party in Freeport.

The shooting was witnessed by two people, one of them an off duty cop, who described the gunman, but their statements weren’t given to the defense or the jury.

They described a darker skinned, and shorter man. Through Freedom of Information requests, Jackson found the error six months ago, which the Nassau DA’s office reviewed and believes was unintentional.

“We felt the conviction needed to be vacated,” Sheryl Anania, Conviction Integrity Unit, Nassau DA said.

The judge told Jackson ‘only you know if you committed this crime, but an error has occurred.’

So why did he sign a confession.

“Because they had me in a room for 39 hours beating the hell out of me,” he said. “I just want people to know I’m innocent. I never committed the crime I was blamed for and the truth came out.”

Now to make up for 23 grueling years.

“I just want to be surrounded by family now. See my mother. I haven’t seen my mother in five years. I’m a little emotional now, you gotta excuse me,” he said.

He headed home to hug his wife, five children, and grandchildren.

The family of the murder victim was notified by the DA’s office that Jackson was freed. They could not be reached for comment.