SAN DIEGO (AP) — Dozens of immigrant children under the age of 5 will be released from government custody and reunited with their parents Tuesday after being separated at the border under President Donald Trump's zero-tolerance immigration policy.

A government lawyer said Monday at least 54 children under the age of 5 would join their parents by a court-ordered deadline, only about half the 100 or so children covered by the order. The Trump administration was working on final background checks for another five children ahead of Tuesday's deadline.

On Monday, Trump's administration acknowledged it would not meet a Tuesday deadline set by a San Diego federal judge to reunite detained children under 5 with their families.

Trump said Tuesday that he has a solution to the missed deadline: "Tell people not to come to our country illegally." Before departing the White House for Europe, Trump said, "That's the solution. Don't come to our country illegally. Come like other people do. Come legally."

Parents in U.S. Immigration and Customs Enforcement custody "for the most part" are being taken to locations near their children and the families will be released, Justice Department attorney Sarah Fabian said in court. She said locations would not be publicly disclosed, but children have been sent to shelters across the country.

More than 2,000 children were separated from their parents by U.S. immigration authorities at the border this spring before Trump reversed course on June 20 amid an international outcry. Last week, U.S. Health and Human Services Secretary Alex Azar said there were "under 3,000" separated children in all.

Late last month, U.S. District Judge Dana Sabraw in San Diego set a 14-day deadline to reunite children under 5 with their parents and a 30-day deadline for older children. The 30-day deadline is up July 26.

American Civil Liberties Union attorney Lee Gelernt sought assurances from the government Monday that advocates would be in position to guide parents when they are released in a foreign land. The parents will be free while their cases wind through immigration court, which can take years, and may be required to wear ankle monitors.

LOS ANGELES, CA - JUNE 30: People demonstrate and call out words of encouragement to detainees held inside the Metropolitan Detention Center after marching to decry Trump administration immigration and refugee policies on June 30, 2018 in Los Angeles, California. Although President Trump was forced to reverse his policy of removing all children from their immigrant or asylum-seeking parents, little clarity appears to be seen as to how agencies can fulfill a court order to reunite thousands of children and parents detained far apart by multiple agencies. Yesterday, the Justice Department filed papers in a Los Angeles federal court to have families arrested for illegal border crossings incarcerated together indefinitely. The rally is one of more than 700 such protests being held throughout the nation. (Photo by David McNew/Getty Images)

On Monday, a federal judge in Los Angeles rejected the Trump administration's efforts to detain immigrant families in long-term facilities, calling it a "cynical attempt to undo a longstanding court settlement."

U.S. District Judge Dolly Gee said the government had failed to present new evidence to support revising a court order that limits the detention of children who crossed the border illegally.

The Department of Justice asked Gee to alter a 1997 settlement, which provides the framework for how to handle detained immigrant children, so it could detain families together for longer periods.

Three years ago, Gee rejected a similar effort by the Obama administration. She ruled at the time that immigrant children generally can't be held longer than 20 days.

Devin O'Malley, a Justice Department spokesman, said the department disagreed with Gee's Monday ruling and continued to review it.

ICE has three family detention centers with room for about 3,000 people in all, and the places are already at or near capacity. The Trump administration is trying to line up thousands of more beds at military bases.

Some attorneys and advocates prepared for Tuesday's reunions with little information.

The Annunciation House shelter in El Paso, Texas, was assisting four parents of children under 5 after their release from immigration detention, none of whom had reunited with their children as of Monday evening, said Taylor Levy, legal coordinator. Levy said that one mother of a 4-year-old was told by federal authorities to find a larger apartment if she wanted her son back.

Abril Valdez of the ACLU of Michigan said the government was "vague" on the time and place of the reunifications that could come Tuesday for two Honduran men he represents. Their 3-year-old sons were in temporary foster care in Grand Rapids while they were in a jail in Battle Creek.

Under-5 children who will remain separated for now include parents have already been released into the U.S., have been deported, or are behind bars on criminal charges.

Sabraw, an appointee of Republican President George W. Bush, said Monday that he was "very encouraged" by the efforts to reunite families by his deadline, calling it "real progress." He ordered both sides back in court on Tuesday to give another update and for him rule on differences over protocols to follow when reuniting the remaining children.

The two sides revealed in a filing late Monday that they are far apart on protocols for reunification, with the government arguing its practices are necessary under federal law to ensure child safety and the ACLU contending that many are too cumbersome under the circumstances. One area of disagreement is DNA testing on parents and children, with the government saying it should be the general rule and the ACLU saying it should be done only when no other evidence is available to prove parentage.

Other areas of disagreement include whether fingerprint checks should be run on other adult members of the household and parent participation a legal orientation program should be required before release.