(Reuters) - A U.S. judge struck back late Friday night at a Trump administration claim that speeding up the reunification of immigrant families separated at the U.S.-Mexican border would put children at risk, saying the government had either misunderstood his instructions or was “acting in defiance of them.”

FILE PHOTO: Immigrant children now housed in a tent encampment under the new "zero tolerance" policy by the Trump administration are shown walking in single file at the facility near the Mexican border in Tornillo, Texas, U.S. June 19, 2018. REUTERS/Mike Blake/File Photo

Last month, in a case brought by the American Civil Liberties Union, U.S. District Judge Dana Sabraw ordered the government to reunite as many as 2,500 children and parents separated as part of U.S. President Donald Trump’s efforts to combat illegal immigration. The separations came after families crossed the border illegally or filed for asylum at a border crossing.

Trump abandoned the practice on June 20 amid a massive public outcry, and the government is now struggling to reunite the families in time to comply with a court-ordered July 26 deadline.

Sabraw has instructed the government to eliminate some time-consuming steps for reunification, including background checks of all adults with whom the child would reside.

On Friday, Chris Meekins, an official with the U.S. Department of Health and Human Services, which houses the detained children, described in a court filing how the agency had streamlined its vetting procedures to meet the deadline.

But he said the revised protocols put children “at risk” and would “likely result in the placing of children with adults who falsely claimed to be their parents or into potentially abusive environments.”

Among other changes, Meekins wrote, the department had stopped using DNA testing to verify parentage, Meekins said.

In his order responding to that filing late Friday, Sabraw accused government officials of “attempting to provide cover ... for their own conduct in the practice of family separation, and the lack of foresight and infrastructure necessary to remedy the harms caused by that practice.”

He reiterated that he had simply ordered the government to follow the same procedures to ensure child safety that Immigration and Customs Enforcement, the agency charged with border security, would have employed in cases where families were never separated. Those protocols include establishing parentage and could include the use of DNA testing “if necessary,” Sabraw wrote.

“Safe and timely reunification of class members and their children can, and will, be done by the court’s deadline,” Sabraw said. “There is no reason why one of these goals must be sacrificed for the other given the vast amount of resources available to the federal government.”

HHS did not immediately respond on Saturday morning to a request for comment.

The agency missed an initial deadline earlier this week to reunite the youngest children with their parents.

Sabraw also ordered the government to pay the costs of reunification, rather than charging parents, at a hearing on Friday.