(CNN) A Pennsylvania man who spent 21 years behind bars for murder was freed Wednesday after the star witness in the case confessed to the killing.

John Miller walked out of the State Correctional institution in Frackville, about 100 miles northwest of Philadelphia, after prosecutors declined to retry him, saying there was insufficient evidence, according to court records.

"I'm very happy and excited that after 21 years I'm finally being heard and that my innocence has reached the surface," Miller said in a written statement distributed by his attorney. "I'm going home to my family. I'm overwhelmed, excited, and happy."

Miller, 44, credited his attorneys with securing his release after years of declaring his innocence.

John Miller has always maintained his innocence.

"Without them, I don't know what would have happened or where I would have been," he said.

Read More