He was part of a growing chorus of public defenders and officials in New York City, led by Mayor Bill de Blasio, who have been pushing for the state courts and the city’s district attorneys to release from city jails people who are especially vulnerable to the virus.

The alternative, they have said, may be a public health catastrophe.

Similar scenarios are playing out in jails and prisons throughout the state and across the country as correction staff members and inmates have tested positive for the virus. Two correction officers in upstate New York prisons, one correction officer in Westchester and an inmate in a Nassau County jail have been found to have the disease, as have two inmates in a federal prison in California.

Mayor de Blasio said his administration was working with prosecutors to free elderly and infirm inmates. On Friday, the district attorneys in Manhattan, Brooklyn, Queens and the Bronx said they had consented to the release of dozens of inmates, though the final decision will be up to the courts.