PORTLAND — Oregon officials are only months away from accepting applications for the state's first medical marijuana dispensaries under a newly enacted law.

PORTLAND — Oregon officials are only months away from accepting applications for the state's first medical marijuana dispensaries under a newly enacted law.

But local leaders who want to keep pot shops out of their communities are clearing the ground for a fight.

In Myrtle Creek, the town's police chief and mayor both oppose dispensaries within city limits. And in Medford, the City Council made a rule change to say that business licenses could be revoked for violating the federal prohibition on the drug. There's no way "to prevent the wholesale distribution of marijuana through dispensaries," said Medford City Councilman Chris Corcoran.

Marijuana activists, who support the law signed by Gov. John Kitzhaber in August, say plans to ban dispensaries run contrary to legislative intent — even if they realize that local authorities will likely have the final say.

"There will be dry counties," said Allen St. Pierre, head of the nation's foremost marijuana advocacy group, likening areas that take steps to ban pot to those that prohibit the sale of alcohol.

"If they don't want people to have retail access to marijuana or massive production of it, there is almost no doubt that no cities or towns can be forced to go that route," said St. Pierre, executive director of the National Organization for the Reform of Marijuana Laws.

Oregon law has allowed for medical marijuana since 1998, but there has been a catch for patients: They could legally possess the drug, but they had to find their own producer or grow it themselves. For patients unwilling or unable to do so, that left options that included the black market.

Marijuana advocates pitched the dispensary law as a course correction. The pot shops, they said, provide safe access to patients and create a viable system of reimbursement to the growers and a more accurate market for marijuana prices by taking pot out of the hands of illicit dealers.

Oregon voters rejected dispensaries in 2010, but legislators passed a bill this year and set in motion a nine-month review process during which the laws implementing the dispensaries would be determined by a committee that includes law enforcement, marijuana advocates, botanists and legislators. In less than five months, applications are set to start coming in.

Cities and counties have at least two options for keeping dispensaries out of their backyards. Like Medford, they can choose not to issue business licenses to dispensaries. Or they can take the matter to federal court, where marijuana is considered a prohibited substance.

A 9th Circuit U.S. Court of Appeals decision in 2012 sympathized with patients who say they need marijuana, but ultimately sided with the federal government's prohibition. In that case, a group of California plaintiffs alleged that the cities of Costa Mesa and Lake Forest violated the Americans with Disabilities Act by taking steps to close dispensaries.

"We recognize that the plaintiffs are gravely ill, and that their request for (Disability Act) relief implicates not only their right to live comfortably, but also their basic human dignity," wrote Judge Raymond C. Fisher. "(However) federal law does not authorize the plaintiffs' medical marijuana use."

Rep. Peter Buckley, D-Ashland, who shepherded the law through the Legislature, said the Oregon Health Authority has final say over the dispensaries, not the cities and counties in which they're based.

His advice to cities taking action to oppose dispensaries: "Take a deep breath and work on the rulemaking process, and then see what you think about it."

But the man who oversees the state's pharmaceutical drug programs — and the committee charged with making the dispensary laws — said cities can set their own rules.

"I would assume that a city is going to have existing law," said Tom Burns of the Oregon Health Authority, "and that city will do what that city wants."