(CNN) California Attorney General Xavier Becerra and Massachusetts Attorney General Maura Healey, along with 18 other state attorneys general, announced a lawsuit Monday challenging the Trump administration's new rule to hold migrant families in detention indefinitely.

"This new Trump rule callously puts at risk the safety and well-being of children. It undermines a decades-old agreement reached in court by the federal government to prevent the unlawful detention of immigrant children," Becerra said in a statement . "We're taking the Trump Administration to court to protect children from the irreparable harm caused by unlawful and unnecessary detention."

The rule, unveiled by the Department of Homeland Security last week, replaces the so-called Flores Agreement that set a 20-day limit for holding children.

Under the Flores settlement agreement, the government is required to release a minor from a non-licensed facility as expeditiously as possible, which has been set at 20 days.

The latest proposal, however, would give the government new licensing authority, allowing the use of either a state license or Immigration and Customs Enforcement detention standards, according to a DHS official, meaning families can be kept longer than 20 days.

Read More