WASHINGTON (Reuters) - The Trump administration said on Thursday that it plans to withdraw from a federal court agreement that strictly limits the conditions under which authorities can detain migrant children, and proposed new rules that it said would enable it to detain minors during their immigration proceedings.

The administration is targeting the Flores Settlement Agreement, a 1997 federal consent decree that places significant curbs on how long and in what conditions the government can detain migrant children as it seeks to dissuade migrants from crossing the U.S. southern border.

Immigrants and their advocates are expected to mount legal challenges to the administration’s effort to exit the agreement, which has been interpreted over the years to set a 20-day limit on detaining children who entered the country illegally, and also requires facilities that house migrant children to be licensed by a state authority.

Trump administration officials have repeatedly referred to the agreement’s standards as “loopholes” that attract migrants by forcing authorities to release people pending their immigrationhearings.

On Thursday, the administration said in a regulatory filing it would seek to terminate the Flores settlement, and put forward regulations it said “parallel the relevant and substantive terms” of the agreement.

The new rules would ensure “that all juveniles in the government’s custody are treated with dignity, respect, and special concern for their particular vulnerability as minors,” the regulation said.

The administration earlier this year asked a federal court to ease the limits mandated by the Flores agreement, but the judge overseeing the agreement, U.S. District Court Judge Dolly M. Gee, rejected those requests.

That attempt by the administration came after it instituted a “zero-tolerance” policy at the U.S. border that led to the separation of thousands of migrant children from their parents. After intense public outcry over the policy, the administration was forced to abandon it, but hundreds of children remain separated from parents who were deported without them.

The regulation proposed on Thursday would create a new federal licensing system, so authorities could hold children with their parents in detention centers that are not licensed by state authorities to hold children.

“The goal is to provide materially identical assurances about the conditions of such facilities...and in turn to allow families to remain together during their immigration proceedings,” the rule states.

The public has 60 days to comment on the proposal, followed by a 45-day period before the court settlement is terminated.