The Trump administration has failed to kill a legal challenge to its practice of separating undocumented parents and children entering the U.S. to flee persecution at home, with a judge handing an early victory to civil rights activists who say the policy is unconstitutional and cruel.

U.S. District Judge Dana Sabraw in San Diego on Wednesday denied a motion to dismiss the suit, in which the American Civil Liberties Union (ACLU) argues that splitting up families at the border violates their due process rights.

The practice, spearheaded by Attorney General Jeff Sessions, caused widespread outrage after images of children in detention centers circulated on social media. The U.S. government argues that separations are necessary to properly prosecute adults who cross into the U.S. illegally, while activists say children are being used as pawns in an informal policy intended to deter migrants.