NEW YORK - Rafael Ruiz embraced his family outside a Lower Manhattan courtroom Tuesday after a judge vacated all charges against him Tuesday, ending a 36-year fight to clear his name.

The now-60-year-old Bronx man served 25 years in prison for a sexual assault that he didn't commit.

His best friend Thomas Curry said he always believed Ruiz was innocent.

"I knew they made a big mistake. Back in those days, the police weren't really investigating things that they should have been doing,” Curry said.

The alleged attack occurred in 1984 in East Harlem. Again and again, prosecutors pressed Ruiz to take a plea deal — at one point even offering a sentence of only one-and-a-half to three years. But he refused.

“I didn't want to take no deal because I'm not a criminal,” Ruiz said.

He was convicted in 1985, sent to prison, and denied parole again and again. He served his full sentence.

“I was thinking about my freedom the whole time I was in there,” Ruiz said.  

More than a decade ago, the Conviction Integrity Unit of the Manhattan's District Attorney's Office referred the case to the Innocence Project. The prosecution's case was based on a single and, ultimately, faulty witness identification.

The late Manhattan Assistant District Attorney Bill Tendy convinced the Innocence Project to take on Ruiz's case. He had worked with private investigator Michael Benvie.

“I'm just happy for him, that's all I'd like to say. I'm just very happy for him,” Benvie said.

“A prosecutor’s job is not just to seek convictions, but to seek justice, to improve prosecutorial practices on the front end and prevent wrongful convictions from happening in the first place,” the Manhattan DA's office said in a statement.

Seema Saifee is a senior staff attorney with the Innocence Project. She said the process was incredibly challenging.

“One thing that is just so shocking is how exhaustingly difficult it is to get an innocent person out of prison and how, in a second, an innocent person can be convicted,” Saifee said.

Ruiz's court records will be sealed and his name taken off all sex offender registries. His family said it is hard not to be angry.

Ruiz's mother died soon after his release, and he lost a quarter century of his life, but they said life for them starts right now.

“I feel like I was reborn again and can start all over with my brother,” said Maria Ruiz, Rafael’s sister.

Ruiz said he wants to spend the rest of his days with his family and maybe find a wife.