The Trump administration announced Wednesday it would move to scrap a major court agreement in order to allow for migrant families to be detained as their cases are being considered, instead of having to release them after 20 days.

Acting Homeland Security Secretary Kevin McAleenan, in a press conference detailing the decision, claimed that the long-standing court order known as the Flores agreement has incentivized illegal immigration and represents a “loophole” in the immigration system.

That agreement prohibited children from being kept in detention for more than 20 days. As a result, officials were releasing entire families to keep them from being separated — though last year the administration did separate families as part of a “zero tolerance” program that was eventually stopped amid bipartisan outcry.

BORDER PATROL NABS NEARLY 200 CENTRAL AMERICAN MIGRANTS NEAR NEW MEXICO PORT OF ENTRY

“Today, the government has issued a critical rule that will permit the Department of Homeland Security to appropriately hold families together and improve the integrity of the immigration system,” McAleenan said. “This rule allows the federal government to enforce immigration laws as passed by Congress and ensures that all children in U.S. government custody are treated with dignity, respect, and special concern for their particular vulnerability.”

The Flores ruling came about as a result of a 1980s case in which a girl named Jenny Flores, then 15, was detained with adults by U.S. authorities after she fled El Salvador. Beginning in 1997, the Flores settlement called for migrant children to be sent to care programs after 20 days, and be given access to medical treatment and visits with relatives. McAleenan said the new rule takes the place of Flores, while keeping many of its terms.

The new rule is slated to go into effect in 60 days, though the change is sure to face a new court challenge.

In July, at a House Oversight Committee hearing on Capitol Hill, Rep. Rashida Tlaib, D-Mich., accused McAleenan and other administration officials of seeking to scrap the Flores Settlement, with the alleged goal “to keep kids longer” in custody.

McAleenan pushed back against that characterization. He explained that he wanted to keep families together for the time necessary it takes for immigration proceedings to go through, and for the justice system to make a ruling on the case.

“We want to keep families together through an immigration proceeding that's fair and expeditious in an appropriate setting,” he said. “That can't be done in 20 days with due process.”

Democrats have slammed the detentions as “inhumane,” but Republicans such as Sen. Lindsey Graham, R-S.C., have claimed that the current system has resulted in children being used to bring adults posing as family members into the U.S., then being released, going back, and doing it again.

CLICK HERE TO GET THE FOX NEWS APP

“This is a sick system, it’s rotten to its core,” Graham told Fox News’ Maria Bartiromo in July, stating that thirty percent of those who cross into the U.S. with children are “fake families,” and that loopholes are used to let the same children come back over and over, bringing different adults with them.

McAleenan said approximately 6,000 migrants fraudulently presented themselves as families.

“No child should be a pawn in a scheme to manipulate our immigration system,” he said.

In addition to putting an end to the 20-day limit, the plans announced Wednesday what also set standards for detention facilities, which have been criticized by members of both parties for not having sufficient resources to keep people in proper living conditions.

Fox News’ Dom Calicchio contributed to this report.