“We decided to take a two-pronged approach to this,” said town administrator Stephen P. Maio.

On Nov. 15, Town Meeting members adopted a zoning bylaw that barred medical marijuana dispensaries anywhere in town. Similar bans were enacted by Reading Town Meeting on Nov. 13,
the Melrose Board of Aldermen on Jan. 22,
and the Peabody City Council on Jan. 24. A 17-month moratorium on dispensaries was adopted by Burlington Town Meeting on Jan. 28.

The five area communities are among many across the state that, citing public safety concerns, have considered bans, restrictions, or moratoriums on dispensaries after passage of November’s state ballot question legalizing medical marijuana. The new state law allows for up to 35 nonprofit dispensaries.

Reading town manager Peter I. Hechenbleikner said the town has several options for responding to the attorney general’s decision. Those include appealing the decision, seeking a moratorium, establishing zoning rules to restrict the location of dispensaries, or doing nothing.

“I think this should be a discussion involving the Board of Selectmen, the Board of Health, our substance abuse coalition, and anyone in the public that wants to weigh in,” he said.

Since the matter is not on the warrant for the April 22 annual Town Meeting, any new proposals would have to addressed later, Hechenbleikner said.

As cities, Melrose and Peabody did not have to seek attorney general approval of their bans. But officials in both communities said they are reviewing the Wakefield and Reading rulings and what actions their cities might need to take in response.

“The ban that was passed in Melrose was done with the best interests of the citizens of Melrose in mind, in order to protect our neighborhoods and our school zones and our business districts,” said Robert Van Campen, Melrose’s city solicitor.

But he added, “We certainly respect the determination that the attorney general has made.” Given that ruling, he said the city is “exploring whatever options may be available,” including enacting a moratorium or a zoning measure imposing restrictions on the location of dispensaries.

Christopher Ryder, chief of staff to Peabody Mayor Ted Bettencourt, said the mayor is aware of the attorney general’s rulings and plans to sit down with the city solicitor and city councilors “to determine the next step.”

The ‘legislative purpose could not be served if a municipality could prohibit treatment centers.’

The state Department of Public Health, meanwhile, is set to release draft regulations on implementing the medical marijuana law on Friday, and to issue final rules May 24. Many communities have said they will look to the state regulations for guidance before drafting local rules.

In its ruling on the Wakefield bylaw, the attorney general’s office said a town banning medical marijuana treatment centers “would frustrate the purpose” of the state law, which it notes is intended “to allow qualifying patients who have been diagnosed with a debilitating medical condition reasonable access to medical marijuana treatment centers.”

“The act’s legislative purpose could not be served if a municipality could prohibit treatment centers within its borders, for if one municipality could do so, presumably all could do so,” the office said.

“We also conclude that municipalities are not prohibited from adopting zoning bylaws to regulate medical marijuana treatment centers, so long as such zoning bylaws do not conflict with the act.”

“We were very disappointed with it,” Maio, the Wakefield town administrator, said of the ruling. “But I think the feeling was that it’s in the best interest of Wakefield not to have these facilities, and we are going to move forward as strongly as we can with what the people wanted.”

Maio said the town would file the appeal either in Superior Court or in the Supreme Judicial Court. He said among the legal arguments it will advance is that the bylaw should be allowed to stand based on the “great deference” given to local bylaws by state law.

Emalie Gainey, a spokeswoman for the attorney general’s office, declined comment on the potential appeal.

Hechenbleikner said that Reading also was disappointed with the attorney general’s rejection of the town’s bylaw.

“I do understand the reasoning from the attorney general’s office,” he said, but added, “I don’t agree with it. I think she could have made a different decision that upholds the right of communities to zone businesses.”

Ruth Clay, the shared public health director for Melrose, Reading, and Wakefield, worked with the three communities in developing the bans.

“We were disappointed, but we made a point and we still believe that the majority of the people who voted for [the state ballot question] were voting for the principles of compassionate care, but not for situations where unauthorized people could be getting marijuana.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.