In this January 2013 file photo, a  community service officer with the Tucson Police Departmen helps log handguns at a gun-surrender event.

PHOENIX — Arizona laws on what cities can do with guns trump local ordinances, the Arizona Supreme Court ruled today.

In an extensive ruling, the justices voided a 2005 Tucson ordinance that says that the police department, after it seizes a hand gun, "shall dispose of such firearm by destroying the firearm.” They said it runs afoul of several state laws.

One that predates the Tucson ordinance specifically prohibits local governments from enacting "any ordinance, rule or tax relating to the transportation, possession, carrying, sale, transfer, purchase, acquisition, gift, devise, storage, licensing, registration, discharge or use of firearms or ammunition.”

And in 2013, lawmakers spelled out that if police seize or acquire firearms, they must sell them to licensed firearms dealers.

Attorneys for Tucson argued that the city — and other charter cities — have specific constitutional powers to enact their own ordinances, regardless of state statutes.

But Justice John Pelander, writing for the court, said that authority is limited to matters of "purely local concern.” And he said the Tucson ordinance does not fit within that definition.

Separately the justices rejected arguments by the city that the law used by Attorney General Mark Brnovich to challenge the Tucson ordinance is itself illegal.

That law, SB 1487, allows any legislator to complain to the Attorney General's Office about a statute or local law he or she believes is illegal. If the attorney general agrees — and Brnovich did in this case — he is empowered to move to withhold half of an offending city's state aid.

Attorneys for the city said that both violates constitutional principles of separation of powers and amounts to illegal coercion.

Pelander disagreed.

"The legislature's apparent objective in SB 1487 was not to usurp executive or judicial authority but rather to require and incentivize political subdivisions to comply with state law,” he wrote. "Likewise, the practical consequence of SB 1487 is to encourage compliance with state law, not to coerce, control, or interfere with executive powers or prerogatives.”