The ruling, which applies nationwide, was another judicial setback for the Trump administration, which has now seen three immigration orders stopped by federal courts in its first 100 days. And as with the rulings halting his two temporary bans on travel from several predominantly Muslim countries, the president’s own words were used against him.

The judge, William H. Orrick of US District Court, wrote that the president had overstepped his powers with his January executive order on immigration by tying billions of dollars in federal funding to immigration enforcement. Orrick said only Congress could place such conditions on spending.

NEW YORK — A judge in San Francisco on Tuesday temporarily blocked President Trump’s efforts to starve localities of federal funds when they limit their cooperation with immigration enforcement, a stinging rejection of his threats to make so-called sanctuary cities fall in line.


Though Justice Department lawyers argued in the case that the government did not intend to withhold significant amounts of money, the judge noted that the president and Attorney General Jeff Sessions had suggested the punishment could be far greater.

“If there was doubt about the scope of the order, the president and attorney general have erased it with their public comments,” Orrick wrote.

While the order is only a temporary injunction until the judge issues a broader ruling on the executive order’s constitutionality, he strongly signaled that San Francisco and Santa Clara County, the plaintiffs in the case, were likely to win a permanent victory. It was also an early verdict on the question of whether the White House can coerce cities and counties into helping federal immigration agents detain and deport immigrants who are not authorized to be in the country.

Trump has criticized judges who have ruled against him, and late Tuesday night the White House released a statement saying, “Once again, a single district judge — this time in San Francisco — has ignored federal immigration law to set a new immigration policy for the entire country.”


Exactly what makes a city or county a sanctuary is a matter of interpretation, but most that present themselves as sanctuaries, including New York, Los Angeles, San Francisco and Houston, limit how much they cooperate with federal immigration authorities, often by refusing to turn over unauthorized immigrants from local jails except under certain conditions or by preventing local police officers from asking about immigration status.

In San Francisco’s case, the city argued that the executive order violated the Constitution by essentially trying to commandeer state and local officials to enforce federal immigration law. In practical terms, San Francisco’s filing said, forcing the city to cooperate with federal immigration agents would threaten public safety by breaking trust between local authorities and immigrants, who the city argued would become less likely to report crimes or serve as witnesses.

The city estimated that it stood to lose more than $1 billion in federal funding as a result of the executive order. Santa Clara said about $1.7 billion, or more than a third of its revenue, was at risk.

“This is why we have courts — to halt the overreach of a president and an attorney general who either don’t understand the Constitution or chose to ignore it,” Dennis Herrera, the San Francisco city attorney, said in a statement. “Because San Francisco took this president to court, we’ve been able to protect billions of dollars that fund lifesaving programs across this country.”


While the judge’s order temporarily stops the White House from placing new restrictions on federal funding without going through Congress, it does not keep the administration from enforcing existing rules on federal grants. In letters to several local governments last week, the Justice Department warned that several current grants could be in jeopardy.

During his campaign and since taking office, Trump has repeatedly attacked sanctuary cities as harboring lawbreakers. Trump and Sessions have seemed particularly galled by San Francisco’s policies, pointing multiple times to the killing of Kathryn Steinle, who was shot in San Francisco in 2015 by an immigrant with a record of multiple deportations.

Sanctuary cities “breed crime; there’s a lot of problems,” Trump told Fox News in February. “If we have to, we’ll defund. We give tremendous amounts of money to California — California in many ways is out of control, as you know.”

But as former President Obama was sometimes thwarted by conservative states and Republican-appointed judges, Trump has been stopped by liberal jurisdictions and, in this case, by an Obama appointee who had been a bundler for his 2008 campaign, according to OpenSecrets, a website run by the Center for Responsive Politics.

In court, lawyers for the government argued that despite Trump’s vows to end all aid to uncooperative sanctuary jurisdictions, the order was intended to do no more than highlight the president’s commitment to hardening immigration enforcement. No more than a few small grants would be affected, they said.


Orrick’s response: If that were true, what was the point?

“The result of this schizophrenic approach to the order is that the counties’ worst fears are not allayed and the counties reasonably fear enforcement under the order,” he wrote.

He also wrote that because the Constitution gives Congress the federal wallet, the president may not impose new conditions on federal funds to municipalities. The Supreme Court has held that the federal government cannot compel states to administer a federal program, the judge wrote, citing a case with very different partisan battle lines: National Federation of Independent Business v. Sebelius, the 2012 case in which the Supreme Court ruled that the government could not withhold Medicaid funding to force states to comply with Obama’s Affordable Care Act.

And, Orrick added, 10th Amendment restrictions on the power of the federal government require that the federal funds at stake be related to the policy in question, so that, for instance, housing funds cannot be yoked to immigration laws.

San Francisco became the first city to sue the administration over the executive order in January, arguing that the order’s provision for cutting off funding to sanctuary jurisdictions was unconstitutional. Since then, at least five other local governments have sued, including Seattle; Richmond, Calif.; and two cities in Massachusetts, and others have vowed to do so if the administration moves to follow through on the executive order.

But, facing the prospect of losing millions in crucial funding and of a showdown with the Oval Office, multiple jurisdictions have already backed away from sanctuary-style policies since Trump was elected.