Updated

A judge on Thursday blocked Montana from prohibiting commercial medical marijuana operations, saying that ban on profits from pot sales will restrict access to patients and deny people the right to seek health care.

Helena District Judge James Reynolds issued a preliminary injunction against portions of a restrictive overhaul of the state's voter-approved medical marijuana law, which was due to take effect on Friday. One part of the law would have limited marijuana providers to distributing to a maximum of three patients and barred them from receiving anything of value for their product.

Montana hasn't banned any other industries from receiving compensation for their goods and services, and the state has declared medical marijuana a legal product, Reynolds said in his ruling. A profit ban would limit the number of willing marijuana providers and deny patients "this fundamental right of seeking their health care in a lawful manner."

"The court is unaware of and has not been shown where any person in any other licensed and lawful industry in Montana — be he a barber, an accountant, a lawyer, or a doctor — who, providing a legal product or service, is denied the right to charge for that service or is limited in the number of people he or she can serve," Reynolds wrote.

Reynolds also blocked provisions of the law banning advertising of medical marijuana, allowing unannounced searches of providers and requiring an investigation into any doctor who recommends marijuana for more than 25 patients in a year.

But he left other changes to the law in place, including stricter requirements of proof of chronic pain before a person can receive a registration card for that condition.

The ruling means medical marijuana providers for now will continue to operate under many of the rules approved by voters in 2004 until the full case can be heard. Critics say the voter-approved initiative is riddled with loopholes and has allowed the industry to spin out of control.

Montana has more than 30,000 medical marijuana users in a state with a population with just below 1 million. That's one of the highest rates among the 15 states that allow medical marijuana use. Critics say the law is too permissive and has created a booming retail industry that peddles a product considered an illegal drug under federal law.

The overhaul passed by the 2011 state Legislature followed an attempt to repeal medical marijuana use in Montana altogether, a bill that was vetoed by Gov. Brian Schweitzer. Lawmakers approved the restrictive measures after federal agents in March raided more than two dozen medical marijuana operations and warned state leaders that prosecutors will pursue anybody suspected of trafficking in the drug.

The Montana Cannabis Industry Association sued the state after the bill was passed, saying the restrictions were an unconstitutional violation of the right to pursue good health. The group had asked the judge to block the entire law from taking effect Friday, and spokeswoman Kate Cholewa said that blocking only portions of it "makes things a little more messy."

The ruling "demonstrates the need to regulate medical marijuana instead of trying to get rid of it through backdoor ways, such as the law that was passed," Cholewa said. But, she added, "Access will be made more difficult for chronic pain patients."

She said her group will move ahead with plans to gather signatures for a proposed referendum to block and repeal the law.

State Department of Justice officials said in a statement that they were pleased Reynolds did not block the entire bill and that important provisions will still go into effect that should curb some of the worst abuses.

"Based on an initial review of the decision, however, we are concerned about the potential consequences of allowing providers to grow and sell marijuana to an unlimited number of cardholders," the statement said.

In his ruling, Reynolds said the other provisions he blocked raised constitutional questions: the ban on advertising medical marijuana could be impair freedom of speech and the unannounced searches of registered premises were a possible violation of the protection against searches and seizures.

He also said the additional checks on physicians was worrying because of testimony from doctors their reputations could be harmed and they might stop certifying patients.

Mike Smith, owner of the Healing Center, which provides medical marijuana for about 100 patients, said the judge's ruling is a victory for patients' rights. He said he hopes the result will ultimately be better changes in the law, which he believes is too open now.

But Smith said he won't reopen his storefront yet. He changed his business model to delivery only after the March raids targeting medical marijuana operations.

"I'm not going to be hanging out on Main Street, but I will be caring for patients," Smith said.