A California federal judge on Tuesday granted a bid by San Francisco and a Silicon Valley county to block President Donald Trump’s executive order to withhold federal funds from so-called sanctuary cities for immigrants, in a ruling that slams the president's reference to the order as "a weapon" to be used "against jurisdictions that disagree with his preferred policies."

In his decision Tuesday, U.S. District Judge William H. Orrick found that San Francisco and Santa Clara County have shown they have standing to challenge the order and are suffering irreparable harm. The judge said Trump’s January executive order cutting federal funding to sanctuary cities violates the separation of powers doctrine and deprives the local governments of their Tenth and Fifth Amendment rights, and threatens to deprive them of hundreds of millions of dollars in federal grants that support core services in their jurisdictions.

“If there was doubt about the scope of the order, the president and attorney general have erased it with their public comments,” Judge Orrick said. “The president has called it ‘a weapon’ to use against jurisdictions that disagree with his preferred policies of immigration enforcement, and his press secretary has reiterated that the president intends to ensure that ‘counties and other institutions that remain sanctuary cites [sic] don’t get federal government funding in compliance with the executive order.’”

The White House also doubled-down on its stance on sanctuary cities. "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," the Trump administration said, adding that "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."