The Trump administration scored its first judicial win in its long-running battle to punish so-called sanctuary cities for defying federal immigration laws.

A three-judge panel on the Ninth Circuit Court of Appeals overturned a nationwide injunction barring Department of Justice from rewarding cities and counties that cooperate with US Immigration and Customs Enforcement in deportations.

Los Angeles officials had sued to stop the DOJ’s Community Oriented Policing Services (COPS) program, saying that it amounted to federal coercion.

But in a 2-1 decision, the court found that the Trump administration has a right to reward behavior that it favors.

“Sanctuary Cities knowingly release criminal aliens out of their jails and back into our communities, instead of cooperating with ICE,” White House press secretary Stephanie Grisham said Friday. “This ruling reverses a lawless decision that enabled Sanctuary City policies.”