Health and Human Services Secretary Alex Azar said Thursday that officials are racing against a federal judge’s “extreme” deadlines to reunite “under 3,000” migrant children separated from their parents at the U.S. border.

Azar did not provide a precise number, but he said hundreds of government employees are poring over databases, examining case files, and conducting DNA tests to reunite families. The children are being held in shelters overseen by HHS. Their parents are in Homeland Security’s immigration jails.

The secretary’s remarks come as the Trump administration prepares for a hearing Friday before the judge who halted the family separations last week, calling the practice “chaotic.” International advocacy groups and Pope Francis had criticized the administration for traumatizing families, including one man who killed himself after his son was taken away.

President Trump has said he took the drastic measure to curb the rising number of illegal border crossings. Figures released by U.S. Customs and Border Protection on Thursday show that apprehensions slumped in June, as they typically do in the hot summer months, though at more than 42,000, the monthly tally is nearly double what it was in June 2017.

Azar said the Trump administration is working to transfer children from HHS shelters to join their detained parents in U.S. Immigration and Customs Enforcement (ICE) facilities, a step that will probably infuriate lawyers who say the migrants should be freed to pursue asylum claims, as the government has done in the past.

In his ruling last week, U.S. District Judge Dana M. Sabraw ordered the Trump administration to return children to their parents by July 26, though children under age 5 must be reunited by Tuesday night. About 100 children younger than 5 are in HHS custody, Azar said, adding that Homeland Security is relocating their parents to facilities near the child shelters. Parents are being vetted first, he said.

“We want this to be as compassionate a process as it humanly can be,” Azar said in a conference call with reporters. “We want to treat people as well as humanly possible going through this very difficult situation.”

Also Thursday, two House Oversight Committee leaders pressed key Trump Cabinet officials for a detailed accounting of the thousands of children separated from their parents since the administration began in May to prosecute every illegal border crossing.

In a bipartisan letter, sent to Azar, Homeland Security Secretary Kirstjen M. Nielsen, and Attorney General Jeff Sessions, lawmakers made 11 specific requests for information about every child — including their age, gender and location.

“Like many Americans, we want to ensure that we can reunite children who have been separated from their families as expeditiously as possible,” wrote Rep. Mark Meadows (R-N.C.) and Rep. Elijah E. Cummings (Md.), the committee’s ranking Democrat.

Although Azar said he would prefer to have children with their relatives back home or in the United States, he signaled they could be held for longer periods in ICE detention.

A 1997 federal consent decree generally prohibits the government from detaining migrant children longer than 20 days, which prompted officials to release entire families in the past. But the Trump administration has complained that many migrants later skip out on their immigration hearings, and officials have explored the possibility of detaining them longer.

“We’ve got a court order that requires at DHS after 20 days that you break families apart, that you separate children from families in ICE custody and send them to us. That’s one side,” Azar said. “We now have a more recent court order requiring that we send those kids back to DHS and ICE custody indefinitely.”

Azar said the administration’s position is that Sabraw’s order “trumps the previous order” and that now “the task is to reunify children in ICE custody.”

The Justice Department has said its goal was to file criminal charges against all migrants who crossed the border illegally, including parents, which forced them to surrender their children because the children cannot be jailed. Since then, some parents have been deported, while others have been released in the United States to await a hearing. About 500 children have been reunited with their parents.

The push to transfer children to immigration jails comes as apprehensions on the southwest border declined 18 percent, from 51,905 apprehensions in May to 42,565 in June. From March to May, more than 50,000 migrants were apprehended each month, infuriating a president who campaigned on securing the border.

The effect of his “zero tolerance” policy is unclear, however, since U.S. Customs and Border Protection said this time of year has a “downward trend” because of high temperatures and hazardous conditions.

Azar worried that the court’s tight deadlines would not allow the government to thoroughly vet parents, but said “we will comply” with the judge’s order. He said two “purported” parents were found to have criminal records, including one with a history of child abuse.

HHS is caring for more than 11,800 minors through a nationwide network of shelters overseen by its sub-agency, the Office of Refugee Resettlement. More than 80 percent of the minors are teenagers, mostly males, who crossed the border alone.

Colby Itkowitz contributed to this report.