A judge Thursday sprang another 28 Rikers Island inmates who were supposed to be transferred to state corrections department drug treatment programs, according to the Legal Aid Society.

The 28 inmates had violated the terms of their parole and were granted admission to either a 90-day or 45-day drug treatment program at a Department of Corrections and Community Supervision-run facility.

But the state DOCCS, which oversees the state’s prisons and alternative drug treatment programs, has halted accepting all transfers from city jails over coronavirus concerns.

Due to the freeze, the inmates had been languishing at Rikers for weeks and were vulnerable to contracting COVID-19 — a violation of their constitutional rights, the Legal Aid Society argued in a writ filed in Bronx Supreme Court.

Justice Alvin Yearwood granted the group’s petition.

“We are glad that the court recognized that their continued incarceration infringed upon basic due process rights and placed them each in grave danger of contracting COVID-19,” Legal Aid Society lawyer Elon Harpaz said in a statement.

”For DOCCS to have left them in limbo, with no end in sight to their incarceration, waiting to be infected with COVID-19, worried that they might become seriously ill or even die, is unconscionable,” she added.

The group has secured the release of more than 160 people, including an accused murderer, due to the contagion’s spread through city and state facilities.

On Tuesday, the Legal Aid Society urged Gov. Andrew Cuomo and DOCCS to free another 105 inmates, arguing that the prisons where they’re housed aren’t equipped to handle the outbreak.

Mayor Bill de Blasio previously said that more than 650 city inmates had been released due to the epidemic.

A DOCCS spokesman and the Bronx DA’s Office didn’t immediately return requests for comment.