Mayor Eric Garcetti and leaders in the Los Angeles immigrant community hailed a federal judge’s ruling Tuesday blocking President Donald Trump’s executive order that threatened to cut funding to so-called “sanctuary cities.”

The ruling by U.S. District Judge William Orrick came in response to lawsuits which were filed by San Francisco and Santa Clara County challenging the constitutionality of the order signed by the president. The city of Los Angeles had filed briefs in support of both suits.

“Today’s ruling by Judge Orrick is good news and reminds us that people’s rights transcend political stunts,” Garcetti said. “The Constitution protects cities’ right to create humane, sensible policies that keep our neighborhoods safe and our communities together. It is time for the federal government to stop attacking cities and scapegoating immigrants, and begin focusing on the hard work of comprehensive immigration reform.”

Garcetti said he “will keep working to defend the rights of all our residents — including immigrants — and fighting to protect our own federal tax dollars, which Angelenos want to invest in keeping their families safe and our city strong.”

The White House criticized the ruling, 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.”

“This case is yet one more example of egregious overreach by a single, unelected district judge,” the statement from the Office of the Press Secretary said. “Today’s 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.”

The White House pledged to “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.”

Los Angeles City Councilman Jose Huizar, who is on the Ad Hoc Committee on Immigrant Affairs and a vocal critic of Trump’s immigration policies, said such battles are going to continue.

“We can’t say at this time that one side won or the other side won, because I think the Trump administration is going to continue to find ways to demonize immigrants, whether it is through his executive orders or his Twitter account or his public speaking,” Huizar said.

The executive order likely could have been applied to Los Angeles because the LAPD only notifies immigration agents it has someone in custody potentially subject to deportation if there is a federal warrant for the person’s arrest.

Garcetti reiterated that stance during his State of the City speech last week, saying the city’s police department would not act “as a federal immigration force.”

The two lawsuits were assigned to the San Francisco-based Orrick, who ruled that Trump has no authority to attach new conditions to federal spending.

“Today’s decision by a federal judge is one more reminder President Trump and members of his cabinet have much to learn about individual and state rights,” said Angelica Salas, executive director of the Coalition for Humane Immigrant Rights of Los Angeles.

“The ruling underscores the president’s actions are not only unpopular but also unconstitutional,” she said.

Thomas A. Saenz, president and general counsel of the Mexican American Legal Defense and Educational Fund, said the ruling “vindicates constitutional limits on executive authority. The order demonstrates that the Trump Administration’s nearly 100-day campaign of bullying must end.”

The executive order reads: “Sanctuary jurisdictions across the United States willfully violate federal law in an attempt to shield aliens from removal from the United States.

U.S. Attorney General Jeff Sessions in March reinforced the order, saying local jurisdictions seeking U.S. Department of Justice grants must first demonstrate they are not sanctuary cities.

Chad Readler, acting assistant attorney general, said the lawsuits were interpreting the executive order too broadly and it would only apply to the U.S. Department of Justice grants, but Orrick ruled the order could be applied to all federal funding.

Orrick’s ruling is another in a series of executive orders on immigration by Trump that have been blocked by the federal courts, including two seeking to prevent visitors from some countries with a Muslim majority from entering the U.S.

The city and county of Los Angeles were among three dozen jurisdictions filing a court brief Wednesday in opposition to President Donald Trump’s executive order threatening to withhold federal funds from sanctuary cities.

The brief was filed in federal court in San Francisco in support of that city’s pending lawsuit challenging the constitutionality of Trump’s proposed crackdown on cities that fail to cooperate with federal immigration authorities.

The court papers argue that pulling funding from cities would threaten public health and safety, while noting that forcing local law enforcement agencies to become arms of federal immigration agencies would lead to a loss of cooperation between immigrants and police, with victims or witness of crimes opting not to come forward out of fear of deportation.

“Today, 36 cities and counties across the nation, representing over 24 million people, joined together to stand up for the health and safety of their communities and oppose President Trump’s ill-conceived and unconstitutional executive order that would require local jurisdictions to perform federal immigration work or risk losing unrelated federal funding,” said Kelly Dermody, an attorney for the coalition of jurisdictions. “Local jurisdictions are in the best position to set these priorities and they understand that driving some residents underground in fear of any interaction with local authorities makes every resident in that community, and those adjacent, less safe.”

Trump signed an order in January threatening a crackdown on cities that fail to report arrests of people potentially subject to deportation.

“Sanctuary jurisdictions across the United States willfully violate federal law in an attempt to shield aliens from removal from the United States,” the order states.

“… We cannot faithfully execute the immigration laws of the United States if we exempt classes or categories of removable aliens from potential enforcement.”

U.S. Attorney General Jeff Sessions on Tuesday reinforced that stance, saying local jurisdictions seeking U.S. Department of Justice grants must first demonstrate they are not sanctuary cities.

Sessions said jurisdictions must prove they are in compliance with Section 1373 of U.S. Code Title 8, which requires notification of federal officials about the immigration status of people in local custody. The policy was issued under the Barack Obama administration in 2016, but was not enforced.

“The American people know that when cities and states refuse to help enforce immigration laws, our nation is less safe,” Sessions said.