WASHINGTON – The Trump administration said Wednesday it was taking steps that would allow it to indefinitely detain undocumented children with their families while their immigration cases are pending.

The move, which Department of Homeland Security officials expect to be challenged in federal court, would end a 20-day limit on detaining children and families. The deadline grew out of a settlement of a class-action lawsuit in 1997, and the administration said it led to a boom in adults bringing children when entering the U.S. illegally.

President Donald Trump said at the White House that once migrants realize that security is tightening along the southern border, fewer will attempt to enter the country illegally. Trump described himself as concerned about migrant children but said Congress should close loopholes in asylum law.

"Very much I have the children on my mind. It bothers me very greatly. People make this horrible 2,000-mile journey," said Trump, who said he was being "very strong" on the border. "When they see if they do get into the United States they will be brought back to their country, they won't come."

The effort to remove the cap on family detentions would keep families together, albeit in custody, rather than separating them by placing parents with Immigration and Customs Enforcement and children at facilities licensed by the Department of Health and Human Services. The administration's proposed rule would allow it to license and monitor detention facilities where children could be held with their parents until their immigration cases are resolved, a process that can take months.

The move in the longstanding lawsuit settlement comes in a year when the conditions at DHS detention facilities have been widely criticized.

“What this will do is substantially increase our ability to end the catch and release challenges that have fueled this crisis," Acting Secretary of Homeland Security Kevin McAleenan said. “No child should be a pawn in a scheme to manipulate our immigration system."

McAleenan said ICE's three current family detention centers have campuslike settings and are fundamentally different from facilities for individuals. In Pennsylvania, the facility has suites for each family and separate wings for classroom learning and medical treatment.

“These standards are high,” he said.

McAleenan said the goal of the proposal is to have fair and expeditious immigration proceedings. The average case for detained migrants was resolved in 50 days in 2014 and 2015, before the lawsuit's settlement was expanded to cover families, he said.

“There is no intent to hold families for a long period of time,” McAleenan said.

Reaction in Congress divided along party lines. The chairman of the House Homeland Security Committee, Rep. Bennie Thompson, D-Miss., called the proposal a new low in the administration's treatment of migrant children and families.

"This regulation will allow the administration to dramatically expand family detention and indefinitely lock up children," Thompson said. "When children have repeatedly died in our care for ailments as simple as the flu, keeping them in indefinite detention defies logic and will lead to deadly consequences. The courts must immediately stop this illegal action.”

The top Republican on the House Judiciary Committee, Rep. Doug Collins of Georgia, said the proposal would reduce migrant adults buying, exploiting and endangering children as a way to enter the United States more easily. The proposal "closes a loophole that has fueled illegal immigration at the expense of young boys and girls," Collins said.

The department’s proposal comes in response to a class-action lawsuit filed in 1985. In the 1997 agreement that ended the lawsuit, known as the Flores settlement, the government pledged to hold undocumented children in the least restrictive setting possible. The settlement eventually was applied to undocumented children who arrived with their parents and has constrained the government's power to detain families for longer.

In 2015, the Obama administration attempted to hold migrant children who arrived as part of families in federal detention in Texas. But a California judge ruled that the Flores settlement applied to those children, meaning that families couldn't be held longer than about 20 days, out of concern for the children's welfare.

The reason for the time limit was the lack of state licensing to ensure the quality of family detention centers. Conditions at federal detention facilities have been contentious. An inspector general's report in June described Customs and Border Protection facilities, where migrants are housed temporarily before being moved to longer-term detention centers, as "a ticking time bomb." A Justice Department lawyer sparked outrage in June after arguing in federal appeals court that the settlement's requirement of safe and sanitary conditions didn't require it to provide soap or toothbrushes to children in short-term holding facilities.

Advocates voiced concerns that longer detention could harm children.

“We are talking about an agency that required a court order just to provide soap to children in their custody,” said Michelle Brune, senior director for migration rights and justice at the Women’s Refugee Commission, an advocacy group. “They continue to protest that requirement and to think they now want to detain children indefinitely in family detention … is outrageous.”

Organizations including the American Academy of Pediatrics have said detaining children for long periods of time even in the best conditions can be harmful to their physical and mental well-being, Brune said.

A better option, she said, would be to restore a program the administration killed after a year and a half in June 2017. That program assigned case managers to families that were released, and those managers then made sure migrants showed up for ICE appointments and court hearings, Brune said. Migrants who lost their cases were more likely to leave voluntarily after getting a fair shot, she said. Case managers cost about $38 per day per family rather than detaining them at a cost of $800 per day, she said.

The Flores settlement would allow the government to hold children for longer periods only in detention centers that are licensed by a state. However, no state licenses facilities where children and their parents are detained together, according to DHS officials.

For example, in 2016 Pennsylvania revoked the state license for a family detention center working under contract for ICE, but the facility remains open while the merits of the revocation are litigated, according to a Congressional Research Service report.

So the administration proposed a new course Wednesday, saying ICE would begin to license its own family detention centers.

ICE has maintained that its detention facilities for families meet high standards for providing shelter, food, recreation and education. ICE's three facilities for holding families include two in Texas – the Karnes County Residential Center in Karnes City and the South Texas Family Residential Center in Dilley – and the Family Residential Center in Berks County, Pennsylvania.

The three family centers have about 3,000 beds. The number of migrant familiesin those facilities represents a small fraction of the approximately 55,600 immigrants held in detention in August, according to the Migration Policy Institute.

The government until recently had left many of the beds at those facilities unused for families, saying it did not have the capacity to transport families from the border to the detention centers.

The rule change sought by the Trump administration is intended to give the government more leeway to indefinitely detain children with their parents. But “the reality is that ICE has very limited capacity for family detention, and so would rapidly need to stand up that capacity or otherwise not detain children for lengthy periods of time,” said Michelle Mittelstadt, a spokeswoman at the institute.

But McAleenan said the number of detained families isn't expected to rise significantly under the proposal because adults would no longer have an incentive to bring children on the dangerous journey.

“We anticipate a similar reaction when migrants understand that a child is no longer that free pass or a passport to the U.S. for migration,” he said.

The regulatory proposal, which is scheduled to be published in the Federal Register on Friday, would establish ICE licensing for the facilities with a goal of removing the 20-day deadline for releasing migrants. The ICE facilities would be inspected monthly by third-party contractors.

But the administration's proposal was challenged in federal court when it was initially published in September 2018 and further litigation is expected. U.S. District Court Judge Dolly Gee, who oversees the Flores settlement, ordered DHS to file a written explanation of the final rule within seven days of publishing it.

Critics of the initial proposal argued that it would lead to indefinite detention. Anastasia Tonello, president of the advocacy group American Immigration Lawyers Association, said when the proposal was unveiled that the regulations would eliminate long-standing, court-mandated protections for minors, resulting in more families, including young children, being detained for longer periods of time.

The influx of migrants in recent years has strained detention facilities across the federal government. Customs and Border Protection has apprehended nearly 800,000 migrants so far this fiscal year, which ends Sept. 30. But the agency has released 137,000 detainees since March 19 on their own recognizance for lack of capacity to house them.

Families now make up a significant portion of migration, in contrast to past years. In 2013, federal authorities apprehended 14,855 family units attempting to enter the country illegally, compared with 432,838 so far this year, according to figures from Homeland Security. Many of the families are from Central America and often turn themselves in to Border Patrol agents because they are seeking asylum.

Jessica Vaughan, policy studies director at the Center for Immigration Studies, a think tank that favors reductions in immigration, applauded the Trump administration’s move to indefinitely detain migrant families pending the outcome of their immigration cases.

She said the “border crisis” was precipitated in large part by the 2015 ruling that it required the government to release adults who entered illegally with their children in under 20 days.

She also said some states have “inappropriately politicized” the issue of certifying federal family detention centers. Under the regulation change the Trump administration is seeking, ICE “will take responsibility of its centers in accordance with federal laws.”

“It’s wrong to have a policy that entices people to come here illegally with their children on a long and dangerous journey in the hands of criminal smugglers, and having to release them into the country has been a burden for the communities where they have settled,” Vaughan said in an email.

If Gee approves of the regulation, she could terminate the Flores settlement and the regulation could go into effect within 60 days of publication.

Cornell University Law Professor Steve Yale-Loehr predicted the Trump administration’s attempt would likely be blocked by the courts.

"President Trump can’t seem to learn from his mistakes,” Yale-Loehr said in an statement. “Federal courts have struck down almost every effort this administration has made to curtail the rights of immigrants. When will President Trump realize that immigrants in the U.S. have due process rights?”

Immigration proceedings are civil, not criminal, in nature, he added. “The public would be appalled if U.S. citizen children were detained indefinitely while waiting for a family court ruling. The U.S. public’s criticism of President Trump’s family separation policy forced the administration to back away from that ill-conceived policy. I hope the U.S. public will criticize this new rule just as forcefully.”

Contributing: Alan Gomez and Daniel Gonzalez

More about immigrant detention:

House report: Trump administration's 'zero tolerance' immigration policy 'harmful, traumatic and chaotic'

Judge panel to Trump administration: Detained migrant kids need soap and toothpaste

'A kennel for dogs': Lawmakers hammer acting DHS chief Kevin McAleenan over migrant detention facilities