The Trump administration said Thursday it is preparing to circumvent limits on the government’s ability to hold minors in immigration jails by withdrawing from the Flores Settlement Agreement, the federal consent decree that has shaped detention standards for underage migrants since 1997.

The maneuver is almost certain to land the administration back in court, where U.S. District Court Judge Dolly M. Gee, who oversees the agreement, has rejected attempts to extend the amount of time migrant children can be held with their parents beyond the current limit of 20 days.

But under changes proposed Thursday by the Department of Homeland Security and the Department of Health and Human Services, the administration said it would issue new regulations that “satisfy the basic purpose” of the Flores settlement and ensure migrant children “are treated with dignity, respect and special concern for their particular vulnerability as minors.”

“Today, legal loopholes significantly hinder the Department’s ability to appropriately detain and promptly remove family units that have no legal basis to remain in the country,” said DHS Secretary Kirstjen Nielsen, in a statement. “This rule addresses one of the primary pull factors for illegal immigration and allows the federal government to enforce immigration laws as passed by Congress.”

The proposal sets up a new immigration battle in court, and comes less than three months after the Trump administration’s short-lived attempt to halt an increase in illegal migration by separating children from parents who entered unlawfully. The practice was widely condemned and forced the administration to reverse course and regroup.

Thursday’s proposed changes amount to the administration’s new attempt to eliminate what it views as major obstacles to effective immigration enforcement. Homeland Security officials say the limits on detaining families have effectively sent a message to would-be migrants that any parent who brings a child can expect to be quickly released from custody after entering the country illegally.

The changes proposed by the administration would allow U.S. Immigration and Customs Enforcement (ICE) to expand its family detention facilities in order to keep parents and children together in custody for lengthier periods. ICE currently has three such facilities, which it calls “family residential centers,” with a combined capacity of about 3,500 beds.

But those facilities are almost always full, and the limitations on child detention under the Flores settlement have been a disincentive to build more. The settlement also mandates that children can only be held in licensed facilities, and the government has struggled to find states willing to do so.

While states typically license child-care facilities, none currently issues licenses to family detention centers.

According to the changes proposed Thursday, the government will ensure new detention facilities meet current standards, “as evaluated by a third-party entity engaged by ICE.” The announcement does not indicate who the third party would be.

Homeland Security officials say that will ensure that those families, many of whom are Central Americans seeking asylum, appear in immigration court.

The Trump administration said Thursday’s proposed changes would also “formalize” the way Health and Human Services cares for migrant children in its custody. The agency oversees a network of about 100 shelters for underage migrants who arrive without a parent or who have been separated. But in recent months allegations of mistreatment and sexual abuse at several shelters have emerged, and HHS has been sharply criticized for not keeping better track of children after they are released to family members or other approved “sponsors.”

The administration’s plans to lift limits on child detention is likely to trigger new legal challenges and could revive still-simmering anger over the Trump administration’s separation of 2,600 migrant children from their parents under a border crackdown this spring. As of last week, more than 500 children were still in federal custody without their parents.

The 1997 Flores Settlement Agreement resulted from a class-action lawsuit over the treatment of migrant children in federal custody.

The proposed regulations would not take effect immediately. Publishing them in the Federal Register triggers a 60-day period for public comments. Then, advocates say, the Flores counsel who represents all migrant children in federal custody would have 45 days to challenge those regulations in court.

The proposal comes weeks after the Trump administration failed to obtain permission to detain children for unspecified periods of time from Judge Gee in Los Angeles.

Justice Department lawyers had asked for permission to detain children and parents together until their cases are adjudicated, a process that can take months.

In July, Gee sharply rebuked the Justice Department’s request, calling it “a cynical attempt, on an ex parte basis, to shift responsibility to the judiciary for over 20 years of congressional inaction and ill-considered executive action that have led to the current stalemate.”

Advocates say the Trump administration has the authority to create regulations to replace the court agreement, but they worry that officials will ignore the substantive protections in its quest to deport immigrants.

In August, the mother of a Guatemalan toddler filed a claim alleging the little girl died in May as a result of negligent medical care while detained with hundreds of other families in Texas.

“The Trump administration is seeking to expand its power to jail families for longer in worse conditions and lock up children indefinitely in unlicensed and inhumane facilities,” said Ai-jen Poo, director of the National Domestic Workers Alliance, in a news conference last month.

“We’re talking about an administration that intentionally and forcibly separated children from their parents knowing the torment and trauma that would cause and we’re now allowing them to set a new standard … of care for immigrant children.”