CHICAGO (AP) — A Cook County judge on Thursday cited alleged torture by Chicago police for freeing a man who spent 21 years in prison for two 1997 murders.

Police allegedly used an industrial-strength paper-cutter to slice off the toes of Jaime Hauad's shoes and threatened to cut off the then 17-year-old's toes if he didn't confess to the murders of alleged gang members Jason Goral and Jose Morales.

The Illinois Torture Inquiry and Relief Commission determined last year that Hauad's claim of torture was credible. The commission noted evidence from two lineup photos, one showing Hauad wearing undamaged shoes, the other showing him in cut shoes.

The commission also noted the murder investigation involved a Chicago police detective who is serving a life sentence for racketeering and drug conspiracy. Testimony at his trial indicated Det. Joseph Miedzianowski abused suspects and fixed cases.

The commission sent the case back to Cook County prosecutors for resolution. The State's Attorney's Conviction Integrity Unit and Hauad's attorneys settled on re-sentencing Hauad for time served and setting him free.

"I want to thank the state's attorney's for the investigation and giving (me) back my life," Hauad told Judge William Gamboney.

"We had enough concerns that we felt a new sentence was appropriate," Cook County Assistant State's Attorney Eric Sussman told Gamboney. "We made a decision jointly that this was the best outcome."

Gamboney signed off on the agreement. The now 37-year-old Hauad could be released from Graham Correctional Center in Hillsboro as early as Friday.

Despite his sentence reduction, Hauad's convictions still stand. Attorney Alison Flaum said Hauad has maintained his innocence throughout the ordeal and they plan to pursue a certificate of exoneration.