Judge says Trump can’t punish cities over sanctuary city policies

City Attorney Dennis Hererra holds a press conference discussing the federal judge's sanctuary city ruling, inside City Hall on Tuesday, April 25, 2017, in San Francisco, Calif. City Attorney Dennis Hererra holds a press conference discussing the federal judge's sanctuary city ruling, inside City Hall on Tuesday, April 25, 2017, in San Francisco, Calif. Photo: Natasha Dangond, The Chronicle Buy photo Photo: Natasha Dangond, The Chronicle Image 1 of / 23 Caption Close Judge says Trump can’t punish cities over sanctuary city policies 1 / 23 Back to Gallery

President Trump can’t coerce sanctuary cities like San Francisco to cooperate with immigration officers by threatening to withdraw crucial funding, a federal judge said Tuesday in a ruling that bars enforcement of Trump’s order nationwide.

In the first legal test of an executive order Trump issued five days after taking office, U.S. District Judge William Orrick III of San Francisco said the president was exceeding his constitutional authority by trying to punish local governments that refuse to cooperate with his immigration policies.

Ruling on a lawsuit by San Francisco and Santa Clara counties, Orrick issued a preliminary injunction that prohibits the administration from enforcing Trump’s Jan. 25 order by cutting off funding to defiant cities and counties. His ruling will remain in effect unless it is overturned by a higher court.

“Given the nationwide scope of the order, and its apparent constitutional flaws, a nationwide injunction is appropriate,” Orrick said.

He said those flaws include trying to force cities and counties to change their policies by threatening their funding, and interfering with Congress’ exclusive authority to place conditions on the use of federal funds.

“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,” San Francisco City Attorney Dennis Herrera said in a statement after the ruling.

Santa Clara County Supervisor Cindy Chavez called the decision “a win for the neediest people in our nation,” whose programs could have been decimated by the loss of federal funds.

The case is primarily a clash over immigration policy — Trump’s aggressive approach to enforcement and deportation versus efforts by hundreds of local governments to protect their residents, regardless of immigration status, and encourage them to cooperate with police without fear of the consequences. But an underlying issue is the economic relationship between Washington and communities dependent on federal dollars to stay afloat.

Without the funding that the Trump administration was threatening to withdraw, San Francisco and Santa Clara County argued, vital health and social service programs would be gutted and residents would suffer. Their lawsuit cited the U.S. Supreme Court’s 2012 ruling that the federal government may not coerce state or local governments to change their laws by threatening to withhold vital funds — in that case, the entire Medicaid grants to states that refused to expand health care for the poor.

The Trump administration said the two counties were grossly exaggerating the likely effect of the president’s order. Orrick disagreed.

Trump’s order is “potentially placing hundreds of millions of dollars of the counties’ federal grants at risk,” the judge said. “The order’s uncertainty interferes with the counties’ ability to budget, plan for the future, and properly serve their residents.”

The ruling is another legal rebuff for an administration that has also seen the courts block Trump’s orders to ban travel to the U.S. from nations whose populations are almost entirely Muslim. Federal appeals courts in Richmond, Va., and San Francisco will take up those cases next month.

In both cases, the president’s legal arguments have been contradicted by his public statements — in the travel-ban case, by his proposals to ban Muslim immigration. Some inconsistency seemed to be on display, as well, in the administration’s response to Tuesday’s ruling.

In a statement, Justice Department spokesman Ian Prior noted that the ruling did not prevent the government from enforcing rules in some of its current grants that require cities and counties to provide certain information to immigration officers or forfeit the grants. Prior also said Orrick did not “purport to (restrict) the department’s independent legal authority to enforce the requirements of federal law applicable to communities that violate federal immigration law.”

Asked whether the administration would appeal, Prior declined to comment. Shortly afterward, White House chief of staff Reince Priebus promised an appeal, and cast aspersions on the court that would be first in line to consider the appeal.

“Again it’s the Ninth Circuit going bananas,” Priebus said, although Orrick is only a trial court judge. “It’s clear forum-shopping that’s going on. ...We will win at the Supreme Court level.”

An appeal would delay plans by the two counties to ask Orrick in June for a final ruling declaring Trump’s order unconstitutional.

Federal law doesn’t define sanctuary cities. But more than 300 cities and counties nationwide have limited the cooperation their law enforcement agencies are allowed to extend to federal immigration officials seeking to detain and deport immigrants for crimes or illegal entry.

Nearly 50 local governments across the country, along with the state of California, filed arguments supporting the suit by San Francisco and Santa Clara County. Separate suits have been filed by Seattle, two communities in Massachusetts, and Richmond in Contra Costa County.

Local governments in the lawsuits said Trump’s order potentially threatened all their federal funding — as much as $2 billion a year for San Francisco, one-fifth of its overall budget, and $1.7 billion for Santa Clara County, more than one-third of its revenue.

A high-ranking Justice Department lawyer, Assistant Attorney General Chad Readler, sought to allay those fears at an April 14 court hearing. Readler told Orrick that the only current funding potentially at risk was contained in three Justice Department and Homeland Security grant programs to local governments that had agreed, as a condition of the funding, to provide information about the immigration status of anyone in their custody.

Herrera’s office says San Francisco receives about $1.5 million a year in those grants, for such programs as reducing crime by ex-convicts and deterring drug use. The city, a spokesman said, complies with the law’s requirement to inform federal officers about detainees’ immigration status. Santa Clara County receives about $1 million in similar funding.

Orrick said Readler’s assurances of limited risk were contradicted by Trump’s public statements and by the terms of his executive order.

For example, Orrick said, Trump told then-Fox News host Bill O’Reilly on Feb. 5 that cutting off funding to sanctuary cities “would be a weapon” to get them to change their policies. Trump has specifically threatened California, Orrick said, calling the state “out of control” and noting that it receives “tremendous amounts of money” from the federal government.

The judge, a 2013 appointee of President Barack Obama, said Readler’s interpretation is also inconsistent with the sweeping mandate of Trump’s executive order. That order directs the attorney general and Homeland Security to make sure that “sanctuary jurisdictions” are “not eligible to receive” any federal grants, Orrick said.

In addition, Orrick said, the president’s order, and comments by Attorney General Jeff Sessions, suggest that it would define sanctuary cities broadly, to cover communities that refuse to comply with immigration officials’ “detainers.” Detainers are requests by the government to hold immigrants in jail after their sentences expire so that federal agents can pick them up. San Francisco does not honor such requests unless the agents have a warrant from a judge.

“The order’s broad directive and unclear terms, and the president’s and attorney general’s endorsement of them,” Orrick said, “has caused substantial confusion and justified fear among states and local jurisdictions that they will lose all federal grant funding at the very least.”

San Francisco Chronicle staff writer Rachel Swan contributed to this report.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter:@egelko