A Philadelphia man who spent 25 years behind bars for a rape and murder he did not commit walked out of prison a free man Tuesday after new DNA tests proved was not guilty.

Anthony Wright was 20 years old when he was arrested in the horrific sexual assault and killing of 77-year-old Louise Talley, who was found naked and stabbed 10 times with a kitchen knife in October 1991.

Though cops claimed Wright, at his own volition, gave a full and complete signed confession 14 minutes after being taken into custody, he always maintained his innocence.

Wright testified at his original trial and the retrial that followed that he only signed the alleged confession, which police wrote out, after detectives threatened to hurt him during the interrogation, according to the Innocence Project, which led his defense.

Wright — who narrowly escaped the death penalty at his original trial, as a jury voted 7 to 5 against it — said he worked at his full-time construction job and later went to a nightclub on the day of the crime.

Wright’s trial saw witnesses — including two admitted crack dealers — testifying for the prosecution all claim they either saw the young man enter the victim’s home alone or describe what he did to Talley.

No one mentioned Ronnie Byrd, a convicted felon twice the age of Wright whose DNA was found in and around the victim.

Byrd died in South Carolina in 2013 and was never able to be questioned about or prosecuted for the crime.

Testing also revealed clothes police claimed Wright wore the night of the murder actually belonged to the victim, who wore them the night she was killed.

“DNA testing proved not only that Mr. Wright is absolutely innocent but also that law enforcement fabricated evidence against him,” Peter Neufeld, co-director of the Innocence Project, said in a statement.

A jury deliberated for less than an hour before finding him not guilty Tuesday afternoon, making Wright the 344th person in America to be exonerated by DNA evidence, the Innocence Project said.

After he was released from Curran-Fromhold Correctional Facility, Wright tearfully hugged his family, who was equally as emotional to have him back.

“It’s been a long time. It’s been a long time,” he said while speaking with KYW Newsradio.

Though all those involved in securing Wright's exoneration — most of all, Wright himself — were relieved, Neufeld said it was also “outrageous that he has been forced to endure a retrial to gain his freedom after DNA testing already proved his innocence.”

Byrd was identified as the real killer three and a half years ago.

“This case raises many serious questions, and Philadelphians should be deeply concerned about the manner in which law enforcement handled this case and should demand a review of three police detectives responsible for Mr. Wright’s wrongful conviction,” he continued.