The suit alleges that the city is violating the NRA’s First Amendment speech rights and has effectively moved to “blacklist anyone linked to the NRA.” In a statement, the NRA’s outside counsel, William A. Brewer III, called the city’s action “an assault on all advocacy organizations across the country.” The lawsuit was filed in U.S. District Court in San Francisco.

Supervisor Catherine Stefani of the San Francisco board introduced the measure on July 30, on the heels of a shooting at a garlic festival in Gilroy, California, that left three dead and more than a dozen others injured. Since then, a spate of mass shootings in Texas and Ohio have renewed calls for expanded background checks of gun buyers, but the NRA has rejected such calls and thus far persuaded President Donald Trump to do so as well.

Stefani, a lawyer, said Monday that she believed the measure would withstand legal challenges.

“It’s a resolution, it’s not an ordinance, it’s nonbinding,” she said. “This is a desperate move by a desperate organization,” she added. “They misspend their members’ dues for their personal gain, they have many pending investigations against them, and they continue to perpetuate a culture of sick and pervasive gun violence in this country. Their time is up.”

She was referring to recent revelations about the NRA’s spending practices, as well as investigations underway by the attorneys general in New York and the District of Columbia, and in Congress.

The NRA has been among Trump’s staunchest allies, and it portrayed San Francisco’s move as part of a pattern of broadsides against it by Democrats, including Gov. Andrew M. Cuomo and Attorney General Letitia James of New York, as well as members of the Los Angeles City Council.

The NRA’s lawsuit called the “terrorist designation” a “frivolous insult.” But it said that “San Francisco’s actions pose a nonfrivolous constitutional threat.”

“In the face of recent, similar blacklisting schemes,” it continued, “financial institutions have expressed reluctance to provide bank accounts for disfavored political groups, and city contractors fear losing their livelihoods if they support or even work with the NRA.”

In a statement Monday, Wayne LaPierre, the chief executive of the NRA, said “this lawsuit comes with a message to those who attack the NRA: We will never stop fighting for our law-abiding members and their constitutional freedoms.”

This article originally appeared in

.