A mother walks with her two daughters in Tijuana, Mexico, on their way to the port of entry to ask for asylum in the United States on Thursday. (Mario Tama/Getty Images)

The Trump administration asked a federal judge in California on Thursday to permit federal agents to detain together those families suspected of illegally entering the country, in the wake of an outcry over the government’s recent practice of separating children from their parents.

The Justice Department filed court papers Thursday seeking a modification to a judge’s order in a long-running court case about how immigrants are detained.

The case, known as Flores v. Sessions, dates back to the Reagan administration, when a 15-year-old girl from El Salvador sued over the conditions of her confinement.

In the case, U.S. District Court judge Dolly M. Gee had previously ruled against the Obama administration over the same issue, finding in 2015 that it had violated the terms of the settlement in the case by detaining mothers and their children in poor conditions.

At the time, the judge ordered such detainees released because of what she called “widespread deplorable conditions” during their time in the custody of Border Patrol agents.

On Wednesday, President Trump signed an executive order meant to reverse his administration’s recent practice of detaining and separating children and their parents or guardians when they are caught trying to enter the country illegally.

Trump signed the order amid a public outcry over the policy, but administration officials have warned the order could run afoul of Gee’s ruling.

Now, the Justice Department is asking the judge’s permission to deviate from some of the terms of that settlement so that immigrant families can be detained together.

“Under current law and legal rulings, including this court’s, it is not possible for the U.S. government to detain families together during the pendency of their immigration proceedings,” the Justice Department lawyers wrote in their filing. “It cannot be done.”

The inability to detain parents and children together “creates a continued incentive for parents to bring their children on the dangerous journey to the United States and to enter the country illegally,” the Justice Department lawyers argued in their papers. “[T]he emergency currently existing on the southwest border requires immediate action. This court can take such action to help address this urgent problem.”

The administration has urged Congress to pass legislation that would accomplish a similar policy change, but the chance of such a bill clearing both chambers appears dim.

On Thursday, there was significant confusion inside the administration about how the president’s executive order should be implemented, and those talks are expected to continue.