LOS ANGELES (CNS) — The state of California has filed suit in Los Angeles opposing the Trump administration’s new rule to lengthen the amount of time children in immigration custody can be held behind bars.

The multi-state complaint attempts to override part of the two-decade old Flores agreement, which outlines a minimum standard of care for migrant children in US custody. The Flores agreement has been in place since 1997 and is overseen by US District Judge Dolly M. Gee in Los Angeles federal court.

The lawsuit, announced by Gov. Gavin Newsom and state Attorney General Xavier Becerra, argues that prolonged detention would cause irreparable harm to children, their families, and the California communities that accept them upon their release from federal custody.

“This new Trump rule callously puts at risk the safety and well-being of children,” Becerra said. “It undermines a decades-old agreement reached in court by the federal government to prevent the unlawful detention of immigrant children. No child deserves to be left in conditions inappropriate and harmful for their age. We’re taking the Trump administration to court to protect children from the irreparable harm caused by unlawful and unnecessary detention. With our partners across the country, we will fight for the most vulnerable among us.”

Joining Becerra in filing the lawsuit is a coalition of the attorneys general of 18 states.

“Yet again, President Trump is disregarding basic human rights and using helpless immigrant children as political pawns to further his ideological agenda,” Newsom said. “California will emphatically assert itself to protect the welfare and safety of all children, regardless of where they come from or the color of their skin.”

Acting Homeland Security Secretary Kevin McAleenan said last week that the new policy would help prevent illegal migration by blocking what he called a “catch and release” loophole in which illegal immigrant families are released into the US after 20 days of detention.

The coalition argues that the Trump administration’s rule interferes with the states’ ability to help ensure the health, safety, and welfare of children by undermining state licensing requirements for facilities where children are held.

The lawsuit alleges that the rule violates both the Administrative Procedure Act and the due process clause of the Fifth Amendment to the US Constitution.