A group of about 30 Brazilian migrants, who had just crossed the border, sit on the ground near US Border Patrol agents, on the property of Jeff Allen, who used to run a brick factory near Mt. Christo Rey on the US-Mexico border in Sunland Park, New Mexico on March 20, 2019.

The Trump administration announced Wednesday a new rule that would allow it to hold migrant families in detention for the length of their immigration proceedings.

But the rule could defy the 2015 Flores Settlement Agreement court order that says families cannot be held in detention for more than 20 days.

Acting Secretary of Homeland Security Kevin McAleenan said in a press release that the rule "ensures children and families in the care of the government are temporarily housed in facilities that are appropriate for their well-being."

He added that keeping families in detention for the duration of their immigration proceedings will result in an "expeditious immigration result."

The rule is expected to be published in the federal register on Friday with an effective date of 60 days, McAleenan said in the release. He acknowledged that the administration expects court challenges that could block the rule from going into effect.

Thousands of immigrants could be affected by the new rule.

The Flores agreement stipulates that any facility holding children for longer than 20 days must be licensed by states, according to NBC News. But no state had licensed a family center for immigrant families.

The administration is proposing to get around this by declaring that ICE detention centers for families are compliant with the agreement because they are licensed by ICE, not a state.

The American Civil Liberties Union said on Wednesday that it has mobilized its supporters to submit over 20,000 comments to DHS and Health and Human Services to fight against the rule.

"This is yet another cruel attack on children, who the Trump administration has targeted again and again with its anti-immigrant policies," Madhuri Grewal, ACLU policy counsel said in a press release. "The government should not be jailing kids, and certainly shouldn't be seeking to put more kids in jail for longer. Congress must not fund this."

Democrats slammed the administration's latest attempt to block immigrants at the border.

"The cruelty of the Trump administration knows no bounds... this new rule is about letting President Trump and Stephen Miller keep children in awful conditions for longer periods of time and continue the administration's horrid treatment of innocent migrant families fleeing unthinkable hardship," U.S. Senator Chuck Schumer said in a statement.

He added it's "imperative" the courts block the rule from going into effect.

Presidential candidate Beto O'Rourke said the new rule only "cages" immigrants even longer than is necessary.

tweet

Billionaire anti-Trump activist Tom Steyer said "holding families indefinitely without due process is a violation of human rights."

tweet

The White House in a press release called Flores a "loophole" that has been "exploited by human smugglers and others who use children as pawns to bring illegal aliens into the country," adding that it has been a "driving force" behind the crisis at the southern border.

The White House and DHS did not immediately respond to CNBC's request for comment.