PHOENIX — Saying state law trumps local control, Attorney General Mark Brnovich ruled Tuesday that a Bisbee ordinance banning plastic bags is illegal.

Brnovich said City Attorney Britt Hanson presented several “compelling reasons” why the community should be able to outlaw plastic bags and require retailers to charge a nickel for paper ones. And the attorney general said he understands the concerns about dealing with flyaway trash.

But he said all that is legally irrelevant. The only thing that matters, Brnovich said, is that the Arizona Legislature voted last year to prohibit local governments from regulating “auxiliary containers.” That means no fees or prohibitions are allowed on containers ranging from bottles and cans to bags.

He said the 2016 law spells out that lawmakers believe such issues are a matter of statewide concern and not subject to local regulations, which overrules the city’s contention that the ban is strictly a local issue.

Brnovich, using the power granted to him under a separate 2016 law, gave the city 30 days to rescind the ordinance. If the City Council refuses, the attorney general said he will direct the state treasurer to begin withholding Bisbee’s share of state aid.

The more likely prospect is that the city will file suit, asking a judge to block the cash loss until there is a final ruling by a court on whether the ordinance conflicts with the preemption.

Among the arguments will be that Bisbee is a “charter city” with state constitutional powers to enact laws on strictly local matters.

Bisbee Mayor Dave Smith said the council will discuss Brnovich’s ruling — and what to do next — at its regularly scheduled Nov. 7 meeting, if not earlier, given the 30-day deadline.

But the odds of the city winning a legal battle may not be good.

Earlier this year, the Arizona Supreme Court looked at a Tucson ordinance that required police to destroy guns that are seized or surrendered. Officials from Tucson argued that it, too, is a charter city and that what happens to guns is none of the state’s business.

But the justices unanimously noted that the Legislature had approved various laws declaring the regulation of guns to be a “matter of statewide concern.” That overrode the city ordinance, they concluded.

The justices strongly suggested they believe that the right of charter cities to ignore state laws applies only in two areas: how and when cities conduct local elections and how they sell or otherwise dispose of land.

The ordinance prohibits retailers from providing free single-use plastic bags; paper bags from recycled material are OK, but are sold for a nickel.