A US federal judge on Monday rejected the Trump administration’s request to allow long-term detention of illegal immigrant children, a key part of President Donald Trump’s executive order to end the separation of immigrant families.

In a ruling in federal court in California, Judge Dolly Gee turned down a US Justice Department motion to modify a 1997 settlement to allow the government to keep underage migrants in detention alongside their parents.

The government asked Gee to suspend the Flores settlement’s requirement that immigrant children be held only in facilities that meet state child welfare licensing regulations, so as to allow whole families to be detained together.

Gee said there was “no state licensing readily available for facilities that house both adults and children”.