A U.S. federal judge on Monday rejected the Trump administration’s request to allow long-term detention of illegal immigrant children, a legal setback for President Donald Trump’s push to detain immigrant families taken into custody at the U.S.-Mexico border.

Los Angeles U.S. District Court Judge Dolly Gee dismissed as “dubious” and “unconvincing” the U.S. Justice Department’s proposal to modify a 1997 settlement known as the Flores Agreement, which says that children cannot be held in detention for long periods.

The government made its request in June after public outcry over its policy of separating children from parents who entered the United States illegally. A judge in a different case in San Diego ordered the government last month to reunite the families it had separated.

The government asserted in its Flores filing that the San Diego ruling would necessitate longer-term detention of children since that would be the only way to both reunite them with their parents and keep the parents incarcerated during their immigration proceedings. Judge Gee rejected that argument.

“Parents who cross the border will not be released and must choose between remaining in family custody with their children pending immigration proceedings or requesting separation from their children so the child may be placed with a sponsor,” Gee said.

Gee called the administration’s request for relief from the Flores agreement a cynical attempt… to shift responsibility to the judiciary for over 20 years of congressional inaction and ill-considered executive action.”