Another judge has ruled against a renewed attempt by the Trump administration to make states and cities help enforce federal immigration law, an effort in which it has persisted despite an unbroken string of court decisions declaring the effort illegal.

The decision late Monday by U.S. District Judge William Orrick III in San Francisco was at least the 10th to tell the Justice Department that without an act of Congress, it can’t withhold federal law enforcement assistance grants from “sanctuary cities” — jurisdictions that decline to help the government track down and detain undocumented immigrants. Among the decisions are three from U.S. Courts of Appeal for the 3rd, 9th and 7th circuits.

In pressing ahead, Orrick ruled, the administration, among other things, usurped Congress’s spending power.

The administration’s two-year losing battle, although a rallying cry for some supporters of President Trump, has raised questions about whether the Justice Department, the nation’s top law enforcement agency, is effectively resisting the courts.

The government’s behavior “flies in the face of a body of law,” said Christopher Lasch, a law professor at the University of Denver who has studied and written about the cases. “These are real, clear-cut legal propositions that they are acting in the face of,” he said, referring to the court decisions.

“The way the administration sees it is a win-win. They are constantly demonstrating to their adherents that they are attacking sanctuary cities,” he said. And because the jurisdictions they’re “going after are not likely to be harboring mass quantities of Trump voters, the costs of losing in court are minimal.”

The Justice Department had no comment Tuesday.

Monday’s case was brought by the city and county of San Francisco and the state of California, which together stood to lose more than $30 million in grants.

The decision was no surprise. Since Trump took office, he and the Justice Department have been targeting state and local governments that decline to help Immigration Customs and Enforcement (ICE) detect and detain immigrants who come in contact with law enforcement officials.

Trump and then-Attorney General Jeff Sessions have claimed, contrary to evidence, that these localities are becoming hotbeds of crime because of undocumented immigrants.

States, counties and cities nationwide have resisted in court, arguing that doing what the administration demands would undermine the trust between immigrant populations and local law enforcement authorities, making it more difficult for police to do their jobs.

They also have successfully argued that the constitutional principles of federalism bar the federal government from telling states what legislation they must pass or not pass, and from making local police enforce immigration laws.

What is unusual is that having lost every one of these battles — in federal district and appeals courts in California, Illinois, New York and Pennsylvania — the administration has not only continued to press its demands but added new immigration-related conditions to 2018 law enforcement grants.

The result has been more court rulings against the government by judges such as Orrick, who already had struck down an earlier sanctuary cities grant restriction.

On Feb. 15, U.S. District Judge Manuel Real urged the government not to withhold grants to Los Angeles for not, in its view, cooperating with ICE. The strings the government attached to the money “upset the constitutional balance between state and federal power by requiring state and local law enforcement to partner with federal authorities,” he wrote.