The Trump administration has released more than half of the youngest children separated from their parents at the U.S.-Mexico border, officials said, but continues to hold the rest as a court deadline to reunite a much larger group of older children approaches.

U.S. District Judge Dana M. Sabraw in San Diego had given federal officials until Tuesday to reunite children under age 5 who were taken from their parents or other adults as part of a crackdown on people crossing the U.S.-Mexico border illegally. Federal officials say they could not return 45 of the 103 children for safety reasons or because their parents were deported or in criminal custody. One parent could not be found.

The family separations — which also involve older children — have sparked international outrage and considerable confusion, with Sabraw warning the government this week to speed the reunification process, including background checks. A report filed with the court late Thursday showed 58 children were reunified across the country, some late at night and across great distances. Children or parents were scattered nationwide, including in Maryland, Texas, New York, Georgia, Louisiana, Arizona and Illinois.

Sabraw told the government to reunite the older children with their parents by July 26. The government has said there are “under 3,000” such children. Officials say they will provide a list of their names by Friday to the American Civil Liberties Union, which filed the class-action lawsuit that led to the judge’s ruling last month.

But in the update filed with the federal court Thursday, ACLU lawyers said the government did not reunite all children with their parents by Tuesday and asked the judge to impose “remedies,” including more information sharing and strict deadlines. Lawyers also asked the judge to order the government to reimburse families for travel costs and to create a fund to pay for counseling for the children.

“There is no excuse for the Trump administration’s missed deadline,” ACLU lawyer Lee Gelernt said in a statement. “Children are suffering because of it. The government must get these families back together.”

The Justice Department did not immediately respond to requests for comment Thursday night.

Earlier in the day, Health and Human Services Secretary Alex Azar, Homeland Security Secretary Kirstjen Nielsen and Attorney General Jeff Sessions said in a joint statement that the government has “worked tirelessly” to reunite children while also ensuring their safety.

“Our message has been clear all along: Do not risk your own life or the life of your child by attempting to enter the United States illegally,” the statement said. “Apply lawfully and wait your turn.”

Court records show that 22 children were not returned because of safety concerns posed by the adults with whom they had been traveling.

Eleven of the adults had serious criminal histories, such as kidnapping and murder, said Chris Meekins, chief of staff for the Office of the Assistant Secretary for Preparedness and Response, which is aiding in the reunification effort. One adult was convicted of child cruelty and narcotics charges.

For the others, the case outcomes remain unclear: Meekins said one adult has been charged with human smuggling, another faces domestic violence charges, one father has an outstanding drunken driving charge in Florida, and another adult is wanted for murder in Guatemala. Others have similar convictions or charges filed against them, officials said.

Other adults were not the parents of the children they brought into the United States, one had a falsified birth certificate, and one was alleged to have abused the child, though it is unclear if charges have been brought.

One parent is being treated for “a communicable disease,” Meekins said, and another had planned to share a house with an adult who had been charged with child sexual abuse.

Earlier this week, officials said that at least one of the children might be a U.S. citizen through a parent. The child’s mother crossed through a legal port of entry in Texas in 2015, and was taken into criminal custody on an outstanding warrant, according to Immigration and Customs Enforcement.

The woman has not been located, court records show.

Officials said they are searching for sponsors for children whose parents are ineligible to take custody of them, such as another parent, relatives or a legal guardian in the United States.

An additional 23 children were not returned because the parents are in criminal custody in the United States or have been sent back to their home countries. The U.S. government is working with foreign consulates in an effort to return children to the 12 deported adults, officials said.

ACLU lawyers have protested that federal officials were taking too long to find deported parents, and dragging out the vetting process for parents still in the United States by testing their DNA and requiring fingerprinting of other household members where they would live in the United States.

Sabraw told the government Tuesday to “streamline” the vetting process and require a “full background check” of everyone in the household and DNA testing of all parents only when there is a legitimate safety concern.

But Meekins said if the vetting had not been done, children could have been placed in dangerous situations, including with people who are not their parents. While most are “perfectly appropriate sponsors” for the children, Meekins said, “sadly, not all are.”

Most parents reunited with the youngest children this week were being released from custody on ankle monitoring devices to await immigration hearings.

But the government has said it may try to detain the older children with their parents after they are reunited. Any such effort would have to comply with a federal consent decree that requires the government to release children from family detention facilities within 20 days.

Some parents had been separated from their children even before Sessions announced the zero-tolerance policy in May, vowing to prosecute everyone who crossed the border illegally. As part of that effort, parents were taken into criminal custody and then immigration jails. Children were held in shelters or foster care.

President Trump stopped the full-scale separations before Sabraw’s June 26 order, amid an outcry over the trauma they were causing to children and parents. His executive order essentially returned the situation at the border to the previous status quo.

The government said early this week that it had 102 children under age 5 in custody, but officials increased that number to 103 on Thursday. Matthew Albence, executive associate director of U.S. Immigration and Customs Enforcement, said an adult who previously said he did not want to be reunited with his child had changed his mind.