San Francisco became the first city to sue the Trump Administration over immigration policy on Tuesday, as City Attorney Dennis Herrera announced a federal lawsuit regarding so-called sanctuary cities.

Flanked by lawyers at City Hall, the city attorney criticized President Trump’s executive order seeking to cut federal funding to cities that restrict the amount local officials will cooperate with federal immigrations agents.

“The president’s executive order is not only unconstitutional, it’s un-American. That’s why we must stand up and oppose it,” he said. “This is not a step I take lightly but it’s one that is necessary to protect the people of this city, this state and this country from the overreach of a president who has shown little respect for our Constitution, states rights or the rule of law.”

The federal funds potentially at stake for San Francisco, which amount to over $1.2 billion, have not yet been cut, but Herrera argued the lawsuit was necessary to prevent that from happening.

Herrera cited previous case law that suggests the federal government “can’t put a financial gun” to the head of local and state governments in order to force them “to act as its agents.” Said Herrera: “That remains true no matter who is in charge of Washington, D.C.”

“Obey the rule of law. Abide by the Constitution,” he said when asked if he had a message for Trump. “You’re not [an] emperor who rules by fiat.”

Along with the executive order, the lawsuit filed in California’s Northern District challenges a federal statute related to information-sharing between state and federal authorities. In addition to Trump and the United States, the suit names Homeland Security Secretary John Kelly and acting attorney general Dana Boente.

While running for president, Trump liked to cite the fatal shooting of a young woman at a popular San Francisco tourist spot as evidence that the border was not secure. Officials in the city, where people voted 85% to 9% against Trump in the presidential election, have vowed to defy him on the issue of sanctuary status.

At the press conference, Mayor Ed Lee argued that “sanctuary cities are safer” because those policies encourage undocumented people to report violent crimes and seek medical care, among other actions, interactions with public agencies which they might otherwise avoid.

Herrera added that there are at least an estimated 30,000 undocumented immigrants in San Francisco, adding that “the comfort and confidence of our residents” is paramount.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Katy Steinmetz at katy.steinmetz@time.com.