A US judge has ordered officials to reunite migrant children separated from their parents within 30 days.
The judge issued the injunction in a lawsuit over family separations under the Trump administration's "zero-tolerance" policy.
Meanwhile the policy of breaking up families at the Mexico border is being challenged by 17 US states.
Democratic attorneys general from states including Washington, New York and California launched the lawsuit.
More than 2300 migrant children have been separated from their parents since early May under the Trump administration's controversial policy, which seeks to criminally prosecute anyone crossing the border illegally.
Tuesday's preliminary injunction was issued by a federal judge in San Diego, Dana Sabraw, in a lawsuit filed by the American Civil Liberties Union (ACLU) on behalf of a mother who was split from her six-year-old daughter after arriving in the US last year.
Court papers filed by the ACLU also contained numerous accounts of parents unable to locate or communicate with their children after they were separated by border officials.
Mr Sabraw ordered the government to reunite parents with their children aged under five within 14 days, and with older ones within 30 days.
The lawsuit launched by the states on Tuesday is the first such challenge to family separations. It was filed with the US District Court in Seattle, Washington.
Last week US President Donald Trump issued an order promising to "keep families together" in migrant detentions.
But the lawsuit states that the order does not mandate the end of family separation and says nothing about reuniting families who have already been separated.
The states involved include Massachusetts, Washington, New York, California, Delaware, Iowa, Illinois, Maryland, Minnesota, New Jersey, New Mexico, North Carolina, Oregon, Pennsylvania, Rhode Island, Vermont and Virginia plus the District of Columbia.
States are now seeking a court order to reunite families and end the separation practice by declaring it "contrary to the Constitution".
It also calls the policy "an affront" to the states' interests in maintaining standards of care for children and preserving parent-child relationships.
"The policy, and the administration's related conduct, has caused severe and immediate harm to the States and their residents."
New Jersey Attorney General Gurbir Grewal said in a statement that the practice of separating families "is cruel, plain and simple", the Associated Press reported.
"Every day, it seems like the administration is issuing new, contradictory policies and relying on new, contradictory justifications. But we can't forget - the lives of real people hang in the balance."
A press release from New York Attorney General Barbara Underwood said migrant children held in New York City had to be treated for depression and suicidal behaviour.
"By tearing children away from their parents and sending them hundreds of miles away, the Trump administration has already caused unfathomable trauma to these children, while undermining New York's fundamental interests in protecting their health, safety, and wellbeing," she said.
Speaking at a news conference in Brazil on Tuesday, US Vice-President Mike Pence warned undocumented immigrants not to "risk the lives of your children" by trying to enter the US illegally.
He said he had a message "straight from my heart" for those planning a journey to America: "If you can't come legally, don't come at all."
On Tuesday, the US health department's Office of Refugee Resettlement (ORR) confirmed that 2,047 migrant children were currently in the care of the agency.
The children have been sent to holding cells, converted warehouses, desert tents or foster care around the US.
ORR director Scott Lloyd refused to say whether the agency was still receiving migrant children who had been separated from their families.
On Monday, the top US border security official told reporters in Texas he had temporarily stopped referring migrants who illegally entered the country with children for criminal prosecution.
Customs and Border Protection Commissioner Kevin McAleenan said it followed Mr Trump's order, but the president had suggested detaining families together instead.
The lawsuit is similar to the case against the Trump administration's travel ban, which was initially blocked by Hawaii until the Supreme Court reversed the ruling on Tuesday morning.