The American Civil Liberties Union asked a federal judge on Thursday to order the Trump administration to account for all migrant children who were separated from their parents at the U.S.-Mexico border, after a government watchdog reported that officials might have split “thousands” more children from their families than they had previously disclosed.

The report, from the inspector general for the Department of Health and Human Services, estimated that the separations extended beyond the 2,700-plus children identified in a class-action lawsuit over President Trump’s border crackdown, which drew widespread condemnation, including from Republicans.

“I was shocked to hear that there were thousands who were separated,” Lee Gelernt, an ACLU lawyer who represents the parents, told U.S. District Judge Dana M. Sabraw during a hearing in San Diego, adding that they could be at risk of being “permanently orphaned.”

Lawyers for the Trump administration countered that other children separated at the border are probably already with their parents or close relatives, and they urged Sabraw to reject the ACLU’s request. They said it would be extremely difficult to retrace the steps of all children who were separated but then released to parents or vetted sponsors.

Justice Department lawyer Scott Stewart said that reuniting the 2,700-plus children, who were in federal custody when he ordered the Trump administration to find their parents, had taken eight months. Going back to a larger group, he said, would “blow the case into some other galaxy of a task.”

Sabraw did not immediately issue a ruling, but he had pointed questions for the government and noted that the ACLU could not have demanded the fuller accounting any earlier because the government didn’t disclose how many children they had actually separated from their families.

“They’re not clairvoyant,” Sabraw said, noting that it is critical to understand where every child went. “It’s important to recognize that we’re talking about human beings. Every person needs to be accounted for.”

The inspector general’s report in January jolted lawyers who had been trying to reunify families since Sabraw ordered them to do so on June 26. Most children were separated as a result of the Trump administration’s “zero tolerance” policy last spring. Seeking to reverse rising border crossings, officials criminally prosecuted parents and then detained them for deportation hearings. Their children, including some babies and toddlers, were sent to live in shelters overseen by the Department of Health and Human Services.

Trump halted the separations on June 20 amid international outcry that it was inhumane, but it soon became clear that the government had not closely tracked the separated families and did not have a system to reunite them.

Days later, Sabraw — an appointee of President George W. Bush — ordered the government to return all separated children who were still in federal custody to their parents.

The ACLU said Sabraw’s order did not cover children who earlier had been taken from their parents and were released from federal shelters to a legal guardian. Some children had been separated as early as July 1, 2017, under a trial run of the “zero tolerance” program in the El Paso sector. The ACLU is seeking information about all of those children and appeared in federal court hoping Sabraw would order the government to turn that information over.

Government officials urged Sabraw in court filings to deny the ACLU’s request, saying the children separated before his order already have been released from federal custody to a legal sponsor.

Those children are “in a different legal position” than those covered in the ACLU lawsuit, the government argued in court documents, adding that Sabraw should not allow the ACLU to “move the goal posts at this late date.”

“The government has worked hard and in good faith over the last eight months to comply with the Court’s orders and to facilitate the reunification process for class members,” the Justice Department said in a court filing.

Cmdr. Jonathan White, the public health official who organized the reunification effort at Health and Human Services, said in a recent court filing that HHS had not tried to locate separated families discharged before Sabraw’s ruling for a host of reasons.

White noted that most children released from federal custody during the past two years had been placed with relatives after mandatory criminal and background checks. In fiscal 2018, 86 percent of children in HHS custody were released to a sponsor. Of those, 42 percent went to a parent and 47 percent to close relatives, while the rest went to more distant relatives or family friends.

Sending government officials to immigrants’ homes months later “could be traumatic to the children,” White said.

But the ACLU said it is concerned that some sponsors are not close relatives, arguing that the government should ensure that all children are given a chance to return to their parents. Advocates worry that some children are in the custody of relatives in the United States who do not have the money to send children home to their deported parents, forcing them to remain separated.

The ACLU did not demand a fuller accounting sooner because it was not aware of the full scope of the problem.

“What we didn’t know is that there were potentially thousands,” Gelernt said in an interview.

The ACLU first filed the lawsuit a year ago, before the “zero tolerance” policy took hold, on behalf of a mother identified in court records only as “Ms. L.” She is a citizen of Congo and had been separated from her young daughter after coming to a legal port of entry to request asylum in late 2017. They were reunited in March.

Weeks later, then-Attorney General Jeff Sessions announced the “zero tolerance” policy to prosecute all adults crossing the border illegally, including those traveling with their children.

Trump argued that immigrants were bringing children along as they tried to cross the border because they knew it was more likely they would be released into the United States. The Department of Homeland Security signed off on the policy of separating parents and children at the border, according to a DHS Inspector General report in September.

But critics, including Sabraw, faulted the administration for launching the unprecedented crackdown without a plan for reunifying families; the government faced huge logistical hurdles because official databases were unable to track the children.

Since children could not remain in criminal jails, officials shuttled them to more than 100 shelters run by the HHS Office of Refugee Resettlement, while their parents ended up in criminal courts and then U.S. Immigration and Customs Enforcement detention while they awaited deportation.

The total number of separated families remains unknown in part because Sabraw did not order the government to provide a full accounting of the episode, according to the HHS inspector general report.

Perry reported from San Diego.