(Reuters) - A U.S. federal judge has ruled that the Trump administration’s ongoing separations of families at the U.S.-Mexico border based on parents’ criminal history or health exclusions are being carried out with proper discretion.

Mexican asylum seekers camping near the Paso del Norte international border crossing bridge while waiting to apply for asylum to the U.S. are evicted by the local government, who will move them to a local shelter, in Ciudad Juarez, Mexico January 7, 2020. REUTERS/Jose Luis Gonzalez

The ruling, by U.S. District Judge Dana Sabraw in San Diego, California, on Monday, was a rare victory for the government in a case that has been ongoing since 2018.

The American Civil Liberties Union (ACLU) first brought the case over President Donald Trump’s “zero tolerance” policy of criminally prosecuting all border crossers, which led to the separation of hundreds of families and sparked national outrage. Sabraw had ordered the administration to find and reunite separated families.

Trump officially halted the practice with an executive order on June 20, 2018. But the ACLU claimed in court that since then, the government has continued the practice and separated more than 1,000 families in violation of Sabraw’s order.

The government has said it separates families when it suspects the parent has a criminal record, a communicable disease, or when there are questions about the relationship between the adult and the migrant child. It claimed its current practice is no different than prior administrations.

The rights group argued, however, that the administration was taking children from parents when they had only minor infractions like traffic violations or previous illegal border crossings.

Sabraw found government officials were “generally exercising their discretion to separate families at the border” in a manner consistent with migrants’ “rights to family integrity and the Court’s orders.”

The judge added there was no evidence before the court that the government has “returned to systematically separating families at the border.”

Sabraw did say that the government should use its rapid DNA testing technology to confirm parentage and not separate families based on “subjective concerns” alone.

The ACLU highlighted that part of the ruling in a statement: “The court strongly reaffirmed that the Trump administration bears the burden if it attempts to separate families based on an accusation that the adult is not the child’s parent,” ACLU attorney Lee Gelernt said.

The group said it was considering its next move in the case.

The U.S. Department of Justice did not immediately respond to a request for comment.