A U.S. judge on Friday said she will block the Trump administration’s rules for the detention of migrant children because they fail to honour a decades-old settlement agreement that spells out the conditions of custody.

The decision came after a hearing where attorneys for detained migrant children said the rules would let the U.S. government keep kids locked up indefinitely and in facilities that aren’t licensed by the state.

U.S. District Court Judge Dolly Gee said during the hearing in Los Angeles that she didn’t see how the new rules adhered to a 1997 settlement that applies to all children — not just those caught on the U.S.-Mexico border without their parents.

“Just because you tell me it is night outside doesn’t mean it is not day,” Gee told government lawyers.

In her decision, she wrote that officials “cannot simply ignore the dictates of the consent decree merely because they no longer agree with its approach as a matter of policy.”

The Trump administration sought to end the agreement as part of its crackdown on asylum seekers arriving on the southwest border. It issued the rules with the hope of detaining migrant children in facilities with their parents.

U.S. District Court Judge Dolly Gee said she didn’t see how the new rules adhered to a 1997 settlement that applies to all children, not just those caught on the U.S.-Mexico border without their parents. (National Asian Pacific American Bar Association via AP)

The 1997 agreement allows for the settlement to be phased out when rules are issued for the care of detained migrant children that honour its terms.

The attorneys who represent detained migrant children celebrated Gee’s position on the case, which she conveyed to them in a draft ruling. They said they wouldn’t let the administration use young migrants to try to deter migrants fleeing desperate conditions from seeking asylum.

“We will continue vigorously to defend the rights of detained immigrant children,” Neha Desai, director of immigration at the National Center for Youth Law, told reporters.

A spokesperson for the Department of Justice said the administration is disappointed with the ruling because it did what was required to implement the new rules.

During the hearing, August Flentje, an attorney for the government, argued the rules were consistent with the agreement, and the government had spent significant time to develop them.

Attorneys for both sides said they would be willing to meet and discuss whether some aspects of the rules aren’t subject to the settlement. Gee gave them until Oct. 4 to do so.

Crackdown on migrants

More than 400,000 migrants travelling in family groups with children have been stopped on the Mexico border in the past year.

In its crackdown, the Trump administration has had migrants await immigration court hearings in Mexico and required those who cross through a third country to seek refuge there before applying for asylum in the United States.

Migrant advocates have decried the changes, which threaten asylum for many people fleeing violence in their countries.

The Los Angeles case dates back to the 1980s, when migrant advocates sued the government over detention conditions for migrant youth. The settlement reached in 1997 requires children to be released from custody as soon as possible to a relative in the U.S.