If the children are younger than 5, they must be reunified within 14 days of the order, issued Tuesday.
U.S. District Judge Dana Sabraw in San Diego issued the order in a lawsuit by the American Civil Liberties Union. The lawsuit involves a 7-year-old girl who was separated from her Congolese mother and a 14-year-old boy who was separated from his Brazilian mother.
Sabraw also issued a nationwide injunction on future family separations, unless the parent is deemed unfit.
More than 2,000 children have been separated from their parents in recent weeks and placed in government-contracted shelters. President Donald Trump last week issued an executive order to stop the separation of families and said parents and children will instead be detained together.
© 2018 Associated Press. All Rights Reserved. Material may not be redistributed.
A judge in California has ordered U.S. border authorities to reunite separated families within 30 days.