By GENE JOHNSON | Associated Press

SEATTLE (AP) — Seattle’s City Council unanimously approved a new tax on the sale of firearms and ammunition Monday, a measure designed to help offset the financial toll of gun violence. But opponents quickly promised a legal challenge.

The council adopted the tax patterned after a similar measure in Cook County, Illinois _ on an 8-0 vote. The tax amounts to $25 for each firearm sold in the city, plus 5 cents per round for nearly every type of ammunition. The revenue would be used for gun safety research and gun violence prevention programs.

The council also unanimously passed a companion measure to require mandatory reporting of lost or stolen firearms. Mayor Ed Murray said he supports both efforts.

“City government can and must pursue innovative gun safety measures that save lives and save money,” Council President Tim Burgess said. “As it has in other areas of policy, Seattle can lead the way in local solutions.”

But gun-rights activists promised to sue on the grounds that the city doesn’t have the authority to impose the measures.

Washington state prohibits local governments from adopting laws related to firearms unless those local ordinances are specifically authorized by state law. City Attorney Pete Holmes said Monday that the tax measure is allowed by the city’s taxing authority, a proposition disputed by Alan Gottlieb, co-founder of the Bellevue-based Second Amendment Foundation. He noted that in 2010, Seattle dropped a rule banning guns in parks after opponents sued on the grounds that the local measure was pre-empted by state law.

“The courts aren’t going to buy it,” he said. “This is not authorized by state law, and therefore it’s not going to hold up.”

Gun safety advocates have struggled with how to deal with what they describe as an epidemic of shootings in the U.S., and the failure of Congress to address it. The Seattle-based Center for Gun Responsibility welcomed the council’s votes, with executive director Renee Hopkins saying they show “what is possible when smart gun laws are given a fair hearing by our elected leaders.”

Between 2006 and 2010, there were on average 131 firearms deaths a year in King County, according to Public Health-Seattle and King County. An additional 536 people required hospitalization for shooting injuries during that time.

According to Burgess, the direct medical costs of treating 253 gunshot victims at Harborview Medical Center in 2014 totaled more than $17 million. Taxpayers paid more than $12 million of that. City officials estimate that the new tax would bring in $300,000 to $500,000 a year, but gun shop owners told council members those numbers are inflated and that the law would cost them customers and sales.

Sergey Solyanik, owner of a Seattle gun shop called Precise Shooter, told the council the tax would simply prompt customers to travel to nearby cities to buy guns.

“The only real purpose of this legislation is to run gun stores out of Seattle,” he said.