A federal judge says the Trump Administration cannot pursue long-term detention of immigrant families.

Judge Dolly Gee of the Federal District Court in Los Angeles rejected the arguments of the Justice Department, and maintained the consent decree that requires children to be released to licensed care programs within 20 days. She said the attempt to modify a 1997 agreement was “a cynical attempt” to shift immigration policymaking to the courts after “over 20 years of congressional inaction and ill-considered executive action that have led to the current stalemate”.

On June 26, Judge Dana Sabraw of the Federal District Court in San Diego ordered the Trump Administration to reunited detained children under 5 with the parents from whom they were seized within 14 days. Children over 5 must be reunited within 30 days.

Facing the Tuesday deadline for the under-5s, held in euphemistically-named “tender care” detention, Government authorities were preparing to return 54 toddlers to parents, moving them hundreds of miles.

But almost 50 under-5s are still separated despite the deadline, with officials hindered by poor record-keeping and quick deportation of parents.

More than 2,000 children remain in detention, after almost 2,800 were taken following the Trump Administration’s “zero tolerance” order in April.

Eleven reunified families will be returned to Guatemala on Tuesday as Homeland Security Secretary Kirstjen Nielsen visits Guatemala City.

Judge Gee rejected the Justice Department’s attempt to portray a surge in border crossings because parents believed they could avoid detention by arriving with children.

“Any number of other factors could have caused the increase in illegal border crossings, including civil strife, economic degradation, and fear of death in the migrants’ home countries,” Gee wrote.

Peter Schey, president of the Center for Human Rights and Constitutional Law, noted that no clause in the 1997 Flores agreement mandates separation of families: “On the contrary, the settlement has offered detained children the right to humane treatment and reasonably prompt release from custody, unless they are a flight risk or a danger, for some 20 years without incident.”