WASHINGTON: The Trump administration struggled Wednesday with how to abide by a federal judge’s order requiring that thousands of migrant children who were forcibly separated from their parents be reunited within 30 days.

The hard deadline set Tuesday night by a U.S. District Judge in San Diego touched off a flurry of activity at facilities already coping with the aftermath of President Donald Trump’s order to end the separation of families at the border.

In his order, U.S. District Court Judge Dana Sabraw, an appointee of President George W. Bush, said all families must be reunited within 30 days, and children under 5 must be reunited with their parents within 14 days. He also issued a nationwide injunction against further family separations, unless the parent is deemed unfit or doesn’t want to be with the child.

Asked about the injunction, Trump offered no complaint, saying, “We believe the families should be together also so there’s not a lot to fight.”

But it remained unclear Wednesday how the administration would meet that deadline, given the amount of red tape and confusion that has hung over the reunification process.

The Department of Health and Human Services’ Office of Refugee Resettlement is taking an average of 57 days to place children in its care with adult sponsors — far longer than the time now allotted by the judge.

HHS, which is in charge of the separated children, referred questions Wednesday to the Justice Department, which in turn said it was up to Congress to deal with the border situation.

“Last night’s court decision makes it even more imperative that Congress finally act to give federal law enforcement the ability to simultaneously enforce the law and keep families together,” the department said in a statement. It added: “Without this action by Congress, lawlessness at the border will continue.”

Meanwhile, the HHS inspector general’s office announced Wednesday that it would be launching a wide-ranging review of conditions at shelters for migrant children focused on safety and health-related concerns, as well as the training and qualifications of federal contractors who are supposed to ensure the well-being of children temporarily in federal custody.

Spokeswoman Tesia Williams said allegations of mistreatment or abuse would be referred to appropriate authorities to investigate as soon as possible. HHS is caring for about 12,000 migrant children, including some 2,000 who arrived at the southwest border with a parent.

The department’s Administration for Children and Families also said in a statement that it was “focused on continuing to provide quality services and care” to minors being held in Office of Refugee Resettlement-funded facilities and reunifying children with relatives or appropriate sponsors.”