Alan Gomez

USA TODAY

A federal judge in San Francisco on Tuesday partially blocked President Trump's attempts to withhold federal grant money to punish "sanctuary cities" that do not fully comply with federal immigration enforcement efforts.

U.S. District Judge William Orrick ruled that Trump exceeded his presidential authority when he signed an executive order Jan. 25 directing his administration to withhold all federal funding from local jurisdictions deemed to be "sanctuary" jurisdictions. That general term describes more than 300 local governments that have limited their cooperation with federal immigration officials.

Orrick said a president has the power to withhold some funding, including three Justice Department grants directly tied to law enforcement. He ruled that the Trump administration can withhold funding under those grounds.

But Orrick said Trump's threats to withhold all federal grants were "coercive" and violated several fundamental principles established in the Constitution.

"The Constitution vests the spending powers in Congress, not the President, so the Order cannot constitutionally place new conditions on federal funds," Orrick wrote.

The ruling marks the latest courtroom defeat for Trump in his quest to limit legal and illegal immigration into the country. Federal judges twice blocked the president's attempts to temporarily suspend legal immigration from majority-Muslim countries.

The White House released a statement late Tuesday night, blasting the judge's ruling as an "egregious overreach."

"Today, the rule of law suffered another blow, as an unelected judge unilaterally rewrote immigration policy for our Nation," the press secretary's office said in the statement. "This case is yet one more example of egregious overreach by a single, unelected district judge. Today's ruling undermines faith in our legal system and raises serious questions about circuit shopping."

White House Chief of Staff Reince Priebus condemned the ruling and said the administration would appeal. Opponents of Trump's immigration policies are "forum shopping" by filing cases in the liberal 9th U.S. Circuit Court of Appeals, and Tuesday's ruling is another example of the success of that tactic, Priebus said.

"Again, it's the 9th Circuit going bananas," Priebus said. "We'll win at the Supreme Court level at some point."

The lawsuit was filed by government officials in San Francisco and Santa Clara who said local governments were facing billions of dollars in lost revenue because of Trump's order. They argued in court that the executive order was overly broad, included vague threats and never defined what the administration considers to be a "sanctuary" jurisdiction.

San Francisco Mayor Edwin Lee applauded the ruling, and California Attorney General Xavier Becerra said it will allow local governments to fight back against the "executive overreach" of the Trump administration.

"Today's decision is a historic affirmation of the U.S. Constitution's core principles — that the President cannot usurp powers not given to him, and that the federal government cannot use federal defunding to coerce local governments into becoming federal immigration enforcers," Santa Clara County counsel James Williams said.

Read more:

Justice Department warns 9 'sanctuary' jurisdictions they may lose funding

Errors prompt Trump to halt reports shaming 'sanctuary cities'

Trump can punish 'sanctuary cities' that protect undocumented immigrants

Justice Department lawyers argued that the order never intended to withhold all federal funding from local jurisdictions. The lawyers argued that cities, counties and states must comply with a section of federal law that requires local jurisdictions to share immigration information on people in custody with the federal government. A violation of those conditions, they argued, would bar the local entities from receiving three Justice Department grants and nothing more.

Justice Department spokesman Ian Prior said Tuesday that the judge "upheld" the government's ability to withhold some federal funding against sanctuary cities.

"The Department of Justice previously stated to the court, and reiterates now, that it will follow the law with respect to regulation of sanctuary jurisdictions," Prior said.

Orrick disagreed with part of the department's interpretation, saying Trump's order allows for all federal funding to be withheld. He issued a preliminary injunction to rein in the scope of the order that will remain in place if the Justice Department appeals.

"It is heartening that the Government’s lawyers recognize that the Order cannot do more constitutionally than enforce existing law," Orrick wrote. "But (the order), by its plain language, attempts to reach all federal grants."

Orrick's ruling means that the Justice Department can continue working to cut off some grants to local jurisdictions. Last week, the department sent letters to nine jurisdictions warning that they may lose funding from one Justice grant if they do not fully comply with federal immigration law. Cutting off that funding will still be allowed under Orrick's ruling.

The ruling also noted that the Trump administration is free to develop a definition for a "sanctuary jurisdiction" and to determine regulations to handle them in the future.