Local officials cannot use federal laws outlawing marijuana to refuse to provide required zoning for dispensaries, the state Court of Appeals ruled Tuesday.

In their unanimous decision, the judges admitted the federal Controlled Substances Act makes the possession and sale of marijuana a felony. And they noted that the zoning sought by White Mountain Health Center was particularly to be able sell the drug from a store in an unincorporated area of Sun City.

But Judge Donn Kessler said Maricopa County Attorney Bill Montgomery had no legal basis to assert that federal law trumps the 2010 voter-approved Arizona Medical Marijuana Act. And he also rejected Montgomery’s contention that having county officials issue the necessary zoning would mean they were aiding and abetting in the violation of federal law.

The fight has its origins in the 2010 initiative that enables those with a physician’s recommendation along with a state-issued ID card to get up to 2 1/2 oz of marijuana every two weeks. That law also set up a network of state-regulated independently run dispensaries to sell the drug.

State health officials need certification from the local government that the website is properly zoned before issuing a license for a dispensary. White Mountain Health, attempting to find in Sun City, sought the required certification from Maricopa County.

But Montgomery instructed county officials not to react. He asserted that doing this would make them guilty of breaking federal laws that prohibit not only the possession and sale but doing anything to facilitate either.

And he claimed that anything the state does cannot preempt federal law.

Kessler said there are many defects with that argument. He said nothing in the Controlled Substances Act forbids states from having their very own drug laws.

Kessler said the undeniable fact that Arizona has decided to legalize the possession and sale of marijuana only immunizes those involved from being prosecuted under Arizona law.

“Arizona, like all other states, has the power to decriminalize certain acts and exempt certain actors for purposes of state law,” Kessler wrote. He said there’s no conflict with federal law because nothing that Arizona does precludes the federal government, if it wants, from applying its own laws.

“The Arizona Medical Marijuana Act will not otherwise purport to protect anyone or any act from federal prosecution,” Kessler wrote.

And also the court rejected Montgomery’s contention that county officials would be guilty of aiding and abetting others to break the Controlled Substances Act.

“To aid and abet, someone must connect himself with the enterprise and participate in it as in something that he wants to bring about and seeks by his actions to allow it to triumph,” Kessler noted. He said there’s no means to conflate the straightforward zoning matter as actively aiding and abetting in the sale of the drug.

And there’s something else..

Kessler pointed out that a provision of a 2015 federal appropriations act expressly forbids the U.S. Department of Justice from using any of its funds to prevent Arizona from enforcing its own laws on the use, distribution, possession or cultivation of medical marijuana. That, he said, removes any basis to assert that county officials who are just doing what the 2010 Arizona law requires might find themselves facing charges of breaking federal laws.

The dispensary has been constructed, with state health officials using earlier court rulings to decide that they didn’t have to wait for the county certification. But Tuesday’s decision undermines future efforts by local governments to attempt to use federal laws to derail marijuana dispensaries.

This isn’t the first time Arizona courts have rejected arguments by prosecutors that federal laws trump what voters approved in 2010. Three years back the Arizona Supreme Court ordered the Yuma County Sheriff’s Office to return marijuana that was confiscated from a patient. That case involved a California medical marijuana patient whose drugs were confiscated at a Border Patrol checkpoint near Yuma. The Border Patrol declined to prosecute, turning over the drugs to the sheriff’s office. Since the girl proved to be a legal medical marijuana user in California, no charges were brought by the county and also the Arizona Medical Marijuana Act expressly acknowledges laws of other states. But Yuma County Sheriff Leon Wilmot refused to return her drugs, claiming that it will place him in breach of federal law.

The Court of Appeals ordered Wilmot to give the drugs back, saying he couldn’t be prosecuted under federal law. Both the Arizona Supreme Court and U.S. Supreme Court refused to disturb that ruling.