(Bloomberg) -- A gun rights organization sued San Jose, California, arguing a first-of-its-kind city ordinance requiring gun owners to purchase liability insurance is unconstitutional.

The National Association for Gun Rights filed the suit Wednesday in federal court in San Jose, a day after the law was passed. The group seeks a court order blocking the ordinance.

The law requires gun owners to carry a gun-liability insurance policy that would cover losses or damages resulting from any negligent or accidental use of the firearm, including death, injury or property damage. Gun owners will also be required to pay a $25 annual fee.

Calling it a first of its kind in the U.S., San Jose Mayor Sam Liccardo said in a statement that “gun-harm reduction fees” from firearms owners will be invested in “evidence-based initiatives” to reduce gun violence. The law, set to take effect in July, is a “constitutionally compliant path” toward achieving its aim, according to the statement.

The law was passed in the wake of the deadliest mass shooting in San Jose’s history last year, when a Santa Clara Valley Transportation Authority employee killed nine people at a rail yard, before killing himself.

The NAGR condemned the city’s plan before filing the lawsuit.

“The ultra-‘woke’ Lefty gun grabbers in San Jose want to make gun owners pay a ‘gun ownership tax,”’ the group said on its website. “This is just as unthinkable as imposing a ‘free speech tax’ or a ‘church attendance tax.”’

In its complaint, the NAGR argues the ordinance won’t deter illegal gun ownership or use, or do anything to recoup money from criminals. “If left intact, the city of San Jose’s ordinance would strike at the very core of the fundamental constitutional right to keep and bear arms and defend one’s home,” the group claims.

“No good deed goes unlitigated,” Liccardo said in an emailed statement. “Fees and taxes on guns and ammunition have existed since 1919 and have repeatedly been upheld.”

Michael R. Bloomberg, founder of Bloomberg News parent Bloomberg LP, is a donor to groups that support gun control, including Everytown for Gun Safety.

The case is National Association for Gun Rights Inc. v. City Of San Jose, 5:22-cv-00501, U.S. District Court, Northern District of California (San Jose).

©2022 Bloomberg L.P.