The Trump administration plans to detain migrant families together in custody rather than release them, according to a new court filing that suggests such detentions could last longer than the 20 days envisioned by a court settlement.

“The government will not separate families but detain families together during the pendency of immigration proceedings when they are apprehended at or between ports of entry,” Justice Department lawyers wrote in a legal notice to a federal judge in California who has been overseeing long-running litigation about the detention of undocumented immigrants.

The filing comes as the Justice Departments seeks to navigate two different court edicts — an injunction issued this week by a federal judge in San Diego that required the government to begin reuniting the roughly 2,000 migrant children still separated from their families, and an older court settlement in federal court in Los Angeles that requires the immigration agencies to release minors in their custody if they are held for more than 20 days.

In the weeks since Attorney General Jeff Sessions announced a zero-tolerance policy toward immigrants illegally crossing the U.S. border, roughly 2,500 migrant children were separated from their parents. About 500 of those children have since been reunited with their parents.

On Tuesday, U.S. District Court Judge Dana M. Sabraw in San Diego issued a preliminary injunction ordering the government to quickly reunite migrant children with their parents, saying that children separated from their families must be returned within 30 days, and allowing just 14 days for the return of children under age 5.

Under the framework of a previous court settlement in the Los Angeles case, the Department of Homeland Security has followed a general practice of not keeping migrant children in the custody of immigration agents for more than 20 days.

The new filing does not explicitly say the Trump administration plans to hold families in custody beyond the 20-day limit, but by saying officials plan to detain them “during the pendency” of immigration proceedings, which in many cases can last months, it implies that families will spend that time in detention.

The Justice Department argued that while the previous settlement had compelled it to release minors “without unnecessary delay,” the new court order, “which requires that the minor be kept with the parent, makes delay necessary in these circumstances.”

President Trump has demanded an end to what critics call “catch and release” — the practice of releasing migrants from immigration detention, many of whom do not show up later for their court hearings. The administration has said 40,579 deportation orders were issued because foreigners did not appear for their hearing in the last budget year.

Civil rights groups and immigrant advocates are likely to seek additional legal action if migrant families are detained for months. What’s less clear is how the judge in the Los Angeles case, Dolly M. Gee, will view the new approach by the government, and whether she will order it changed.

The filing could spur the judge to approve long-term family detentions. Alternately, the judge may order the administration to release families with monitoring bracelets — though that could provide a political opening for President Trump and other administration officials to blame the judiciary for forcing them to let illegal immigrants into the country.

Leon Fresco, who served as deputy assistant attorney general for the Office of Immigration Litigation in the Obama administration, said officials had always had the ability to hold kids with families past 20 days — if the parents consented to it. But under President Barack Obama, Fresco said, officials felt it would be too cruel to present mothers with a Sophie’s choice between turning their child over to refugee resettlement authorities, or keeping them detained.

The latest filing, he said, indicated that the Trump administration would be at least willing to do that.

“What they want to do is put the choice to the mom, separate or not separate, but make the choice so onerous that there really is no option other than to stay in family detention,” Fresco said.

Matt Zapotosky and Nick Miroff contributed to this report.