A federal judge in San Diego gave the Trump administration six months on Thursday to identify potentially thousands of additional children it quietly separated from their parents in the months before the administration’s official “zero tolerance” policy triggered international outcry last spring.

U.S. District Judge Dana Sabraw had ruled in March that the Trump administration was responsible for all of the children the government separated from their parents and not just the 2,700-plus children who remained in federal custody on June 26 when the judge ordered officials to reunite the families.

The Trump administration’s zero-tolerance policy at the U.S.-Mexico border separated scores of families from May to June 20 in an attempt to deter rising numbers of Central Americans from crossing the border with their children. Trump said the immigrants were exploiting legal loopholes to apply for asylum and win release in the United States. Under the policy, officials prosecuted adults for the crime of crossing the border and sent their children to federal shelters across the country.

But a government watchdog later discovered that thousands more children may have been taken from their parents starting as early as July 1, 2017, in a trial run of the zero-tolerance policy, but efforts to track them were so poor that the exact number is unknown.

Lawyers for the Trump administration had protested that most of the earlier separated children had already been released to a parent or guardian, and said it could take up to two years to find them all.

But on Thursday, the Justice Department said the administration is prepared to “get the job done” — hopefully by the Oct. 25 deadline.

Sabraw’s ruling followed testimony Thursday from a Department of Health and Human Services official who said the federal agencies would use electronic databases, statistical modeling and other tools to attempt to identify all separated children.

“What we are striving for ultimately is an accurate accounting of substantially all the children who meet these criteria as quickly as is possible,” Jonathan White, a commander for the U.S. Public Health Service who led HHS’s effort to return children to their parents, testified in court Thursday. “At the end of the day, it is our goal to produce an accurate accounting.”

Sabraw, an appointee of Republican President George W. Bush, praised White for leading the earlier effort to reunite the 2,700 children with their parents, which is nearly completed. The judge acknowledged that the latest effort to identify the children is more challenging because the children have been released from federal custody, but he said he was heartened that the government had a plan to find them.

“You made it happen the first time,” Sabraw told White during the hearing. “I have absolute confidence that you can make it happen this time as well.”

Justice Department lawyers are expected to turn over the children’s names and contact information on a rolling basis to the American Civil Liberties Union, which filed the class-action lawsuit on behalf of the separated parents, so that they can contact the families and ensure that everyone has had the chance to reunite with their parents.

“I don’t see a need to pin a deadline to his efforts when it’s quite clear that he’s going to proceed with all dispatch either way,” Justice Department lawyer Scott Stewart said of White. “By all indications, the appropriate approach is: Green light, keep the court posted, provide the rolling lists, and let’s get this job done timely.”

But the ACLU said Sabraw’s past deadlines had helped ensure families were brought back together.

“This order shows that the court continues to recognize the gravity of this situation,” ACLU lawyer Lee Gelernt said in a statement after the hearing.

White said Thursday that he did not know how many children were separated, but he said the government is committed to finding a way to identify all of the children.

“The reason would never be that something is too much of a burden,” he said during the hearing.