CHICAGO (AP) — Cook County prosecutors have dropped murder charges against two longtime prison inmates who were granted new trials after contending a Chicago detective beat them into confessing.

Prosecutors told a judge Thursday they had no choice but to drop the charges after his decision last week to throw out the confessions of Gabriel Solache and Arturo Reyes.

The judge concluded now-retired Detective Reynaldo Guevara lied when he said the men confessed to the 1998 stabbing death of a Chicago couple.

The decision clears the way for Solache and Reyes to be released from custody after nearly 20 years.

It also brings to at least six the number of inmates who spent years behind bars before their own allegations against Guevara helped them win their freedom.