A judge gave President Donald Trump's administration six months to identify migrant children who were separated from their families for reunification, a process the White House previously stated would take up to two years.

The Department of Health and Human Services Inspector General estimated in a report that thousands of children were separated even before the "zero tolerance" policy last May and June that prosecuted immigrant parents who crossed the border illegally while holding their children separately in HHS custody.

Lawyers representing the Trump administration said in a filing this month that it would take one to two years to identify potentially thousands of children who fit into the category.

But Judge Dana Sabraw of the Southern District of California on Thursday ordered the administration to have its plan completed by Oct. 25. According to Sabraw's order, the timeline may be modified for a "showing of good cause."

“This order shows that the court continues to recognize the gravity of this situation,” said Lee Gelernt, the deputy director of the ACLU’s Immigrants’ Rights Project, in a statement Thursday.

Neither the Department for Health and Human Services or Homeland Security immediately responded to a request for comment from NBC News.

The ruling came after the American Civil Liberties Union argued that a list of some of the children separated "very likely exists" because Customs and Border Protection began assigning numbers to track families in April 2018.

Justice Department lawyers have stated that they want three months to create a statistical model before reviewing files. The ACLU called that "wholly insufficient given that the entire review of every file can be done within three months."

Gelernt, the ACLU's lead attorney in an April 6 lawsuit against the Trump administration over family separations, said that the "government’s proposed plan reflects the administration’s continuing refusal to treat these separations with the urgency they deserve."

"We are talking about the lives of children, potentially thousands of them," Gelernt said. "The government was able to quickly gather resources to tear these children away from their families and now they need to gather the resources to fix the damage.”

A status conference was set for May 17.