Demonstrators link hands across the Golden Gate Bridge on Jan. 20 in San Francisco. Organizers described the event as a community-based demonstration and performance art piece intended to be a “shining beacon of inclusiveness and democracy.” (Photo by Elijah Nouvelage/Getty Images)

San Francisco sued President Trump on Tuesday over his executive order to defund jurisdictions that are so-called “sanctuary cities,” the latest salvo in what promises to be a long battle between liberal cities and states and Trump’s administration.

The lawsuit is the first over Trump’s directive to withhold federal money from the municipalities, which typically do not alert state or federal authorities about a person’s immigration status. Trump’s order, signed last week, directs the Department of Homeland Security to find ways to defund states and cities out of step with his immigration priorities, a move that could at great financial cost to cities such as New York, Los Angeles and Washington.

The lawsuit, filed by San Francisco City Attorney Dennis Herrera, argues that Trump’s order violates the 10th Amendment.

“The Executive Order is a severe invasion of San Francisco’s sovereignty,” the lawsuit says. “The Executive Branch may not commandeer state and local officials to enforce federal law.”

San Francisco code prohibits the city and its employees from using funds or resources to disclose someone’s immigration status or to assist in the enforcement of federal immigration law. It also prohibits law enforcement from detaining a person solely on his or her immigration status. It was a policy, Herrera argued at a news conference, that was enacted because undocumented immigrants feared that they would be deported if they reported crimes to police.

People pass graffiti along the border structure in Tijuana, Mexico, on Jan. 25. President Trump has moved to tighten immigration controls. (AP Photo/Julie Watson)

“Using city and county resources for federal immigration enforcement breeds distrust of local government and officials who have no power to change federal laws, and can also wrench apart family and community structures that support residents and thus conserve resources,” Herrera wrote.

White House officials did not immediately respond to a request for comment Tuesday.

San Francisco first passed an ordinance declaring itself a sanctuary city in 1989, in response to thousands of Central American refugees coming to the United States. The city is estimated to have 30,000 undocumented immigrants. It receives $1.2 billion in federal funding, though it is unclear what might be at risk from Trump’s order.

Sanctuary cities have become an early flash point between Trump and local elected officials around the country. The California legislature has vowed to fight Trump’s order and is considering a bill that would make the entire state a sanctuary for undocumented immigrants. Mayors including Bill de Blasio (D) of New York, Betsy Hodges (D) of Minneapolis and Jorge Elorza (D) of Providence, R.I., who is the son of immigrants, have vocally opposed Trump’s order and vowed to resist it.

Miami-Dade County Mayor Carlos Gimenez (R) essentially discarded his municipality’s sanctuary city status in the wake of Trump’s order. Gimenez issued an executive order compelling the city’s corrections department to honor all immigration detainer requests from the Department of Homeland Security.

During the presidential campaign, San Francisco became a flash point in the debate over sanctuary cities after 32-year-old Kathryn Steinle was shot and killed on a city pier by an undocumented immigrant who had a lengthy criminal history and had been deported five times. During the presidential campaign, Trump repeatedly evoked Steinle’s name, stating in 2015 that her death was a “senseless and totally preventable act of violence committed by an illegal immigrant” and that it was “yet another example of why we must secure our border immediately.”

At a news conference Tuesday, Herrera slammed Trump, casting him as a president who “does not appear to understand the Constitution and the limits it imposes on executive power” and has shown “little respect for our Constitution, states’ rights or the rule of law.”

“The president’s executive order is not only unconstitutional, it’s un-American,” Herrera said.