THE MONTHS-LONG litigation over migrant minors detained with their parents during the pandemic is the latest chapter in the sorry saga of the Trump administration’s efforts to use children as leverage in its war on immigrants. On June 26, a federal judge ordered the release of the remaining scores of youths at the three family detention centers run by U.S. Immigration and Customs Enforcement — but not before the coronavirus had begun taking a toll on residents and staff there.

The facilities, two in Texas and one in Pennsylvania, are petri dishes for covid-19, as Judge Dolly M. Gee of the U.S. District Court for the Central District of California warned in March, when the pandemic’s grip was tightening. At the time, the judge agreed with lawyers representing the detainees that “the threat of irreparable injury to their health and safety is palpable,” and she ordered ICE to “make continuous efforts” to free them.

It’s true that since then, the great majority of children have been released from the centers or deported with their parents. But even now, more than 120 children remain, held by an administration that disdains what President Trump refers to as “catch and release” for migrants awaiting adjudication of their cases. Under Judge Gee’s order, they must be freed by July 17.

What previous administrations regarded as humanitarian treatment of migrants is, in Mr. Trump’s view, little more than an incentive for more undocumented immigration. Under that theory, he has tried to overturn a 1997 court decree that puts strict limits on the conditions and time that migrant children can be detained — a decree grounded in data showing that detention causes lasting damage to minors. So far, the courts have blocked the administration from scrapping the decree, known as the Flores agreement. Yet despite a rule limiting detention of children to 20 days, many of the children now in the ICE facilities have been there for months, even as the pandemic intensified.

Now, Judge Gee’s patience has run out. “The family residential centers are on fire, and there is no more time for half measures,” she wrote. Her order noted that the detention centers had failed to fully comply with recommendations from the Centers for Disease Control and Prevention designed to impede the spread of the virus in institutional settings, including social distancing, mask-wearing and quick medical attention for those who suffer covid-19 symptoms. In a court filing last week, ICE revealed that at one of the family detention centers, in Karnes City, Tex., 11 children and parents have tested positive for the coronavirus.

Some of the families remaining in detention are appealing deportation orders; conceivably, some may not show up for court hearings after they are released. Yet as the Flores settlement established, putting children at risk by detaining them is inhumane and impermissible. That peril is now compounded by the coronavirus. Together, those risks outweigh the Trump administration’s interest in using the threat of inflicting suffering on minors as a warning to prospective migrants who might enter the country illegally.

Read more: