U.S. District Judge Dana Sabraw in San Diego ruled Tuesday that U.S. immigration officials could not separate immigrant families caught illegally crossing the Mexican border and need to reunite the separated families of children under 5 within 14 days and children older than 5 within 30 days.

The order was part of a lawsuit filed by the American Civil Liberties Union on behalf of a 7-year-old Congolese girl separated her Congolese mother and a 14-year-old Brazilian boy separated from his mother.

Sabraw’s ruling also stops future separations nationwide, unless the parent has been determined to be unfit.

Details haven’t been shared about the logistics of reuniting the approximately 2,000 separated children with their parents, especially considering reports that hundreds of children have been taken to different cities all over the country.