WASHINGTON — The Trump administration announced on Wednesday that it intends to hold migrant families in detention for the duration of their immigration proceedings, with no limit on the time they can be detained.

The new rule, announced by acting Department of Homeland Security chief Kevin McAleenan, may be in defiance of a 2015 federal court ruling known as the Flores agreement that limited the time families could be detained to 20 days.

Although the rule is expected to be published in the federal register on Friday with the effective date of 60 days, the administration expects court challenges that could prolong or even stop the rule from going in place altogether, the officials said.

The move could affect thousands of migrant families.

The Flores agreement said all facilities holding children for longer than 20 days must be licensed by states. But no state had licensed a family center for immigrant families.

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

Download the NBC News app for breaking news

Two DHS officials said ICE has stricter licensing requirements than many states. For example, the family residential centers will be subject to routine third party audits, the results of which will be made public, the officials said.

Currently, detained immigrants take about two months on average to have their immigration cases adjudicated, but the officials said there is no limit on how long a family can be detained under the new rule.

Central American asylum seekers wait to be transported to a processing facility after crossing the Rio Grande in Los Ebanos, Texas, on June 28. Loren Elliott / Reuters

The Trump administration has tried to work around the 2015 Flores decision by 9th Circuit Court of Appeals Judge Dolly Gee for years.

In 2018, the administration used Flores as justification for the “zero tolerance” policy, whereby children were separated while their parents were detained.

Of immigrants detained during their immigration proceedings, 97 percent who received final orders of deportation were actually removed from the country. While 82 percent of those who were not detained were never deported, DHS officials said.

About 66 percent of families released from detention do not show up in court, they added.

Because of limited detention space in ICE detention facilities, one DHS official said he expects the new rule to apply to only about 5 to 10 percent of families crossing the border.

Families may still be released on bond, if a judge determines they are not at risk for not showing up in court or a risk to the public.