In the latest judiciary blow to the Trump administration’s immigration agenda, a U.S. District Court Judge blocked the president’s plans to deny funding to jurisdictions deemed uncooperative on federal immigration enforcement. The administration had hoped to end so-called “sanctuary cities” by forcing them into compliance with federal law. However, these cities already comply with federal law, and Trump’s order does not.

Tuesday’s decision was in response to a lawsuit filed by the cities of San Francisco and Santa Clara, California who argued that President Trump’s order violated the separation of powers and the Tenth Amendment’s prohibition against commandeering local jurisdictions. They also argued that the provision was too vague, and that it threatened to deprive localities of funding without notice. The preliminary injunction will stay in place while the lawsuits continue.

Using the president’s own words against him, the court pointed out that Trump had said he planned to use defunding as a “weapon” against jurisdictions that disagree with him. The judge found that the executive order went beyond the limits of federal law and violated core constitutional principles. Furthermore, he found that the localities did demonstrate that they have standing to challenge the executive order and are suffering irreparable harm because their constitutional rights were violated and the threats caused budgetary uncertainty.

The threat to withhold funding was a provision of the January 25 Executive Order, “Enhancing Public Safety in the Interior of the United States.” On April 21, Attorney General Jeff Sessions sent a letter to nine “sanctuary” jurisdictions—the state of California; New York City; Chicago; Philadelphia; Clark County, Nevada; New Orleans; Miami-Dade County, Florida; and Milwaukee County, Wisconsin; and Cook County, Illinois—and demanded that they show compliance with federal law or risk losing funding. However, these jurisdictions are already in compliance with federal law, and do cooperate on immigration enforcement.

Federal law does not define a “sanctuary” city. The letter sent on Friday refers to 8 U.S.C. §1373, which is a federal statute that prohibits state and local governments from enacting laws or policies that limit communication about “information regarding the immigration or citizenship status” of individuals with the Department of Homeland Security (DHS). The statute also prohibits restrictions on maintaining such information.

However, the statute does not mandate that jurisdictions comply with immigration detainers and does not prohibit policies or laws that restrict compliance with detainers. Federal statute does not require state or local law enforcement to collect information on immigration or citizenship status either. In fact, as the District Court found, federal actions intended to force local jurisdictions to perform immigration enforcement likely violate the Tenth Amendment of the U.S. Constitution.

The jurisdictions that received the letter maintain that they are in compliance with the law and are therefore eligible for continued federal funding.

“We’re not going to cave to these threats,” stated Milwaukee County Supervisor Marina Dimitrijevic. California State Senate Leader Kevin de Leon rejected the administration’s demand, saying “Their constant and systematic targeting of diverse cities and states goes beyond constitutional norms and will be challenged at every level.”

All of these jurisdictions cooperate with the federal government on immigration. Even in these “sanctuary” jurisdictions, officials send federal immigration agencies the fingerprints of any person—including an immigrant—booked into a prison or jail through the Secure Communities Program. The federal government uses that information to identify noncitizens for deportation.

The courts have now found that the administration’s plans suffer from legal and constitutional problems. But they also spread misinformation about how local communities are working with their immigrant communities. For example, the letter described the jurisdictions as “crumbling under the weight of illegal immigration and violent crime.” But research shows that there are, on average, 35.5 fewer crimes committed per 10,000 people in sanctuary counties compared to non-sanctuary counties.

Local officials have resisted the federal government’s attempts to overtake their jurisdictions, arguing that they know how to best serve and protect their communities. Cities that aim to build trusting and supportive relations with immigrant communities should not be punished,” the U.S. Conference of Mayors and Major City Chiefs Association said. “…This is essential to reducing crime and helping victims, both stated goals of the new administration in Washington.”