The Trump administration announced new regulations on Wednesday that will allow migrant families — including children — to be detained indefinitely until their court cases are settled.

The new rules effectively gut the Flores Settlement Agreement, a 1997 court order outlining standards of care for migrant kids in federal custody that limits how long federal immigration authorities can detain minors. Under Flores, migrant children can be detained for a maximum of 20 days, a limit the new rule ended to allow for indefinite detention.

In 2015, a federal judge ruled that the regulations outlined in Flores apply to families traveling with children, which the Trump administration has repeatedly characterized as a “loophole” in the immigration system because it forced entire families to be released into the country.

But under the new rules, expected to be published in the federal register on Friday, migrant children can be detained indefinitely, which will also allow families to be held indefinitely while they wait for their asylum cases to be heard.

“The new rule closes the legal loophole that arose from the reinterpretation of Flores, which Congress has refused to do,” Kevin McAleenan, the acting secretary of the Department of Homeland Security, said at a Wednesday morning press conference announcing the new policy. McAleenan added that the new rule “particularly benefits legitimate asylum seekers with meritorious claims.”

McAleenan said the new rule will allow Immigration and Customs Enforcement to indefinitely detain families in “campus-like” facilities, adding that the new rule is indicative of the administration’s desire to keep migrant families together.

McAleenan said ICE’s family detention facilities are “appropriately fundamentally different” from Border Patrol stations, highlighting the family detention center in Berks, Pennsylvania as an example.

“There’s a large community living room that has [a] big-screen television, cushioned couches, a gaming area, and a separate library that contains books, other televisions sets, video games, and board games,” he said, as well as an educational wing for children.

Instead of building new family detention centers, McAleenan said, the administration will be detaining families at Berks, as well as the South Texas Family Residential and the Karnes Residential Center in Texas. Together, the three facilities have space for approximately 3,000 “family beds.”

Although McAleenan said the standards of care in family detention are higher than those in Border Patrol processing centers, immigrants in these facilities have alleged abuse and mistreatment.

In 2016, more than two dozen mothers detained at Berks went on a hunger strike to protest conditions in the facility. In an open letter to then-DHS secretary Jeh Johnson, the women said they were denied adequate mental health care, and that many of their children suffered from anxiety, depression, and suicidal ideation as a result of being detained.

McAleenan acknowledged that ICE doesn’t have the ability to detain all the families that arrive at the U.S.-Mexico border, and characterized the new rule as part of a multi-pronged strategy that, along with the Remain in Mexico policy and the administration’s safe third country agreement with Guatemala, will stem the flow of asylum-seekers.

McAleenan said the rule, along with these policies, will deter prospective migrants with children from making the trek to the U.S.-Mexico border.

If allowed to go into effect the new rule would be a decisive win for the Trump administration, which has chafed under Flores and has long searched for ways to detain migrant families for longer periods of time. But it’s unclear when the rule will go into effect. On Tuesday night, Homeland Security officials told reporters that the administration expects the rule to be challenged in court.