Immigrant advocates are decrying the Trump administration’s move to end a federal agreement that limits how long immigrant children can be kept in detention.

Advocates say prolonged detention would traumatize immigrant children, adding that Homeland security has a record of subpar treatment of children and families in its facilities.

“What is the most troubling about this news is that the same department and the same facilities that have allowed six children to die under their watch are now claiming that they can provide oversight internally on their own facilities,” said Roxana Norouzi, deputy director of Seattle’s OneAmerica. “That is just … it’s outrageous. And this is real, real harm that’s being cost to children in our in our country that we have a responsibility to protect and stand up for.”

A court fight will almost certainly follow over the government’s desire to hold migrant families until their cases are decided. The current settlement — known as the Flores Settlement and overseen by the federal courts — now requires the government to keep children in the least restrictive setting and to release them as quickly as possible, generally after 20 days in detention.

“The Flores agreement is really one of the few legal protections that children have in the detention system,” said Andrew Craycroft, staff attorney for the Immigrant Legal Resource Center in San Francisco. “Just as recently as last week advocates went to the Ninth Circuit to get the government to abide by the agreement that it’s already supposed to be following and provide children with basic necessities, soap, toothbrushes. Rather than agreeing to do this the government is now essentially trying to undermine this agreement rather than upholding their responsibilities to the children that are in their custody.”

Homeland Security officials said they are adopting their own regulations that reflect the “Flores agreement,” which has been in effect since 1997. They say there is no longer a need for court involvement, which was only meant to be temporary. But the new rules would allow the government to hold families in detention much longer than 20 days. It is the latest effort by the administration to tighten immigration, President Donald Trump’s signature issue, and is aimed at restricting the movement of asylum seekers in the country and deterring more migrants from crossing the border.

“If you’re fleeing from your fear for your life nothing is going to deter you, these sorts of tactics to scare and threaten and bully immigrant families is not only unjust it’s not who we are as a country,” Norouzi said.

Immigration attorney and director of the University of Houston’s Immigration Law Clinic, Geoffrey Hoffman, says the Trump administration’s attempts to change child immigrant detention policies could have dire humanitarian consequences.

“There is the danger, I think, of really making things worse because what we’re really talking about is indefinite detention, detaining people who have past credible fears, credible fear interviews, and then detaining them for as long as their immigration court case could take,” Hoffman said. “Right now, we have a million, more than a million plus, backlog in terms of the immigration courts. So, if you look at that million court case-backlog, how long is it going to take for a case to proceed? Now, it may take a year, may take two years. Most likely it’s going to take several years. And then what the government’s trying to do is say all of those people who are in detention, all the families who are in detention, should be detained indefinitely while that process is pending.”

Acting Homeland Security Secretary Kevin McAleenan said Wednesday the regulations create higher standards to govern family detention facilities. The facilities will be regularly audited, and the audits made public. The regulations are expected to be formally published Friday and go into effect in 60 days absent legal challenges.