A federal judge on Tuesday ruled that U.S. immigration agents could no longer separate immigrant parents and children caught crossing the border from Mexico illegally, and must work to reunite those families that had been split up in custody.

United States District Court Judge Dana Sabraw granted the American Civil Liberties Union a preliminary injunction in a lawsuit filed over the family separations. More than 2,300 migrant children were separated from their parents after the Trump administration began a "zero tolerance" policy in early May, seeking to prosecute all adults who crossed the border illegally, including those traveling with children.

The ACLU had sued on behalf of a mother and her then 6-year-old daughter, who were separated after arriving last November in the United States to seek asylum and escape religious persecution in Democratic Republic of Congo. While they were reunited in March, the ACLU is pursuing class-action claims on behalf of other immigrants.

Trump issued an executive order to end the family separations on June 20, but the government has yet to reunite about 2,000 children with their parents.

Before the preliminary injunction ruling, the U.S. government urged Sabraw not to require that it stop separating and quickly reunite migrant families after they illegally cross the U.S.-Mexico border, saying President Donald Trump's executive order last week "largely" addressed those goals.