At least 10 states plan to sue the Trump administration over the separation of migrant children as a result of its "zero tolerance" policy at the U.S.-Mexico border and over President Donald Trump’s latest executive order, which he says will end the separations.

"This is a rogue, cruel and unconstitutional policy," Washington Attorney General Bob Ferguson said in a statement on Thursday. "We're going to put a stop to it."

The lawsuit will challenge the constitutionality of separating children from their parents "as a matter of course" when they are caught crossing into the United States illegally, alleging a violation of due process, Ferguson's office said.

The states that are suing will also ask that Trump change the executive order by creating a process to unify families that were separated, Ferguson's office said. The executive order, which Trump signed Wednesday after widespread outcry over the separations, left unclear how the administration will reunite already separated children with their parents.

Massachusetts, California, Maryland, Oregon, New Mexico, Pennsylvania, New Jersey and Minnesota will join in the suit, and possibly others, according to Ferguson's office.

New York Gov. Andrew Cuomo has also announced a separate multiagency lawsuit over the separations. Among the claims, it will allege that holding children apart from their families is a violation of their constitutional rights, and that even detaining children with their families runs afoul of the Flores settlement, which says children cannot be detained with their families for more than 20 days.

Also Thursday, the Department of Justice asked a federal judge to let the government detain migrant families for periods beyond the 20-day limit of the Flores settlement.

Washington Solicitor General Noah Purcell said state officials acknowledge that the administration has the discretion to prosecute those who cross the border illegally, but "it's a question of what happens to the children when they’re being detained basically solely for immigration violations.”

"What they’re doing right now is unconstitutional," he said at a news conference. "It violates statutes and just basic constitutional principles about trying to keep families together."

The Trump administration has said it is following the law by prosecuting border crossers. Attorney General Jeff Sessions in April announced the "zero tolerance" policy and directed prosecutors along the border to prosecute them. Trump's executive order does not change that directive.

Pennsylvania Attorney General Josh Shapiro, whose state is joining the lawsuit, characterized the Trump administration's family separation policy as "un-American."

"The executive order President Trump signed yesterday does not fix this abhorrent policy, and we will not allow this administration to use children as leverage in political battles," Shapiro said in a statement.

Cuomo, a Democrat, said in an op-ed in the New York Times published Wednesday that Trump’s executive order "is no solution at all" and that "it still leaves open the long-term detention of immigrant children, which would clearly violate federal law."