Moina Shaiq holds a sign at a rally outside of City Hall in San Francisco, Wednesday, Jan. 25, 2017 (AP Photo/Jeff Chiu)
SAN FRANCISCO (AP) - A federal judge on Tuesday blocked President Donald Trump's attempt to withhold funding from "sanctuary cities" that do not cooperate with U.S. immigration officials, saying the president has no authority to attach new conditions to federal spending.
U.S. District Judge William Orrick issued the preliminary injunction in two lawsuits - one brought by the city of San Francisco, the other by Santa Clara County - against an executive order targeting communities that protect immigrants from deportation.
The injunction will stay in place while the lawsuits work their way through court.
The judge rejected the administration's argument that the executive order applies only to a relatively small pot of money and said Trump cannot set new conditions on spending approved by Congress.
Even if the president could do so, those conditions would have to be clearly related to the funds at issue and not coercive, as the executive order appeared to be, Orrick said.
"Federal funding that bears no meaningful relationship to immigration enforcement cannot be threatened merely because a jurisdiction chooses an immigration enforcement strategy of which the president disapproves," the judge said.
It was the third major setback for the administration on immigration policy.
White House chief of staff Reince Priebus described the ruling as another example of the "9th Circuit going bananas."
The administration has often criticized the 9th U.S. Circuit Court of Appeals. Orrick does not sit on that court but his district is in the territory of the appeals court, which has ruled against one version of Trump's travel ban.
"The idea that an agency can't put in some reasonable restriction on how some of these moneys are spent is something that will be overturned eventually, and we will win at the Supreme Court level at some point," Priebus said.
San Francisco City Attorney Dennis Herrera praised the ruling and said the president was "forced to back down."
"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," Herrera said in a statement.
Santa Clara County Counsel James Williams said the ruling will allow cities and counties across the country to prepare budgets without the "unconstitutional threat of federal defunding hanging over our heads."
A Justice Department attorney, Chad Readler, previously defended the president's executive order as an attempt to use his "bully pulpit" to "encourage communities and states to comply with the law."
Readler also said the order applied to only three Justice Department and Homeland Security grants that would affect less than $1 million for Santa Clara County and possibly no money for San Francisco.
But the judge said the executive order was written broadly to reach all federal grants and potentially jeopardized hundreds of millions of dollars in funding to San Francisco and Santa Clara.
He cited comments by the president and Attorney General Jeff Sessions as evidence of the order's scope and said the president himself had called it a "weapon" to use against recalcitrant cities.
The government hasn't cut off any money yet or declared any communities to be sanctuary cities. But the Justice Department sent letters last week advising communities to prove they are in compliance. California was informed it could lose $18.2 million.
"Sanctuary cities" is a loosely defined term for jurisdictions that don't comply with immigration authorities.
The Trump administration argued that the executive order applied narrowly to cities that forbid officials from reporting people's immigration status to federal authorities. But Orrick said it could also be construed to apply to cities that refuse to hold jail inmates for immigration authorities.
The Trump administration says sanctuary cities allow dangerous criminals back on the street and that the order is needed to keep the country safe. San Francisco and other sanctuary cities say turning local police into immigration officers erodes the trust that is needed to get people to report crime.
The order has also led to lawsuits by Seattle; two Massachusetts cities, Lawrence and Chelsea; and a third San Francisco Bay Area government, the city of Richmond. The San Francisco and Santa Clara County lawsuits were the first to get a hearing before a judge.
On Tuesday, mayors from several cities threatened with the loss of federal grants emerged from a meeting with Sessions saying they remain confused about how to prove their police are in compliance with immigration policies.
The sanctuary city order was among a flurry of immigration measures Trump signed after taking office in January, including a ban on travelers from seven Muslim-majority countries and a directive calling for a wall on the Mexican border.
A federal appeals court blocked the travel ban. The administration then revised it, but the new version also is stalled in court.
READ The full White House statement issued Tuesday by the Office of the Press Secretary:
Today, the rule of law suffered another blow, as an unelected judge unilaterally rewrote immigration policy for our Nation. Federal law explicitly states that a Federal, State or Local government entity or official may not prohibit, or in any way restrict, any government entity or official from sending to, or receiving from, the Immigration and Naturalization Service information regarding the citizenship or immigration status, lawful or unlawful, of any individual. 8 U.S.C. 1373(a). That means, according to Congress, a city that prohibits its officials from providing information to federal immigration authorities -- a sanctuary city -- is violating the law. Sanctuary cities, like San Francisco, block their jails from turning over criminal aliens to Federal authorities for deportation. These cities are engaged in the dangerous and unlawful nullification of Federal law in an attempt to erase our borders.
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. This decision occurred in the same sanctuary city that released the 5-time deported illegal immigrant who gunned down innocent Kate Steinle in her father's arms. San Francisco, and cities like it, are putting the well-being of criminal aliens before the safety of our citizens, and those city officials who authored these policies have the blood of dead Americans on their hands. This San Francisco judge's erroneous ruling is a gift to the criminal gang and cartel element in our country, empowering the worst kind of human trafficking and sex trafficking, and putting thousands of innocent lives at risk.
This case is yet one more example of egregious overreach by a single, unelected district judge. Todays ruling undermines faith in our legal system and raises serious questions about circuit shopping. But we are confident we will ultimately prevail in the Supreme Court, just as we will prevail in our lawful efforts to impose immigration restrictions necessary to keep terrorists out of the United States.
In the meantime, we will pursue all legal remedies to the sanctuary city threat that imperils our citizens, and continue our efforts to ramp up enforcement to remove the criminal and gang element from our country.
Ultimately, this is a fight between sovereignty and open borders, between the rule of law and lawlessness, and between hardworking Americans and those who would undermine their safety and freedom.
Associated Press writers Sadie Gurman and Julie Bykowicz in Washington contributed to this story.