HELENA, Mont. — A federal judge has ruled that Montana’s medical marijuana law doesn’t shield providers of the drug from federal prosecution, delivering a new blow to an industry reeling from a state and federal crackdown.

U.S. District Judge Donald Molloy on Friday dismissed a civil lawsuit filed by 14 individuals and businesses that were among more than two dozen medical marijuana providers raided by federal agents last year across Montana.

The providers claimed the raids violated their constitutional rights in part because state law passed by voter initiative in 2004 allows them to grow and produce the drug for medical consumption.

Molloy wrote in his order that the providers can be prosecuted under the federal Controlled Substances Act even if they are following state law. He cited a 2005 U.S. Supreme Court decision that said the U.S. Constitution’s supremacy clause applies in medical marijuana cases.

The supremacy clause says that federal law prevails if there is any conflict between state and federal statutes.

“Whether the plaintiffs’ conduct was legal under Montana law is of little significance here, since the alleged conduct clearly violates federal law,” Molloy wrote. “We are all bound by federal law, like it or not.”

The federal raids in March 2010 placed a chill over Montana’s booming medical marijuana industry, causing several providers to close down because their inventories had been seized or out from fear that their businesses would be next. Several raided providers have pleaded guilty to federal drug charges.

Lawmakers struggled last year to come up with a solution for what many people perceived to be an industry that at that time was growing too quickly and with too few rules. The final bill repealed the original voter-approved law in favor of one that aimed to dramatically curtail the for-profit medical marijuana industry.

That legislative action is currently under legal review, and will also appear on the November ballot for voters to endorse or reject.

Portions of the new law have been temporarily blocked by a state judge, but the result has been a dramatic decline in the number of medical marijuana patients and providers. There were 18,012 registered marijuana users at the end of December, compared to 31,522 at the end of May, according to the state Department of Public Health and Human Services.

There were 395 registered marijuana providers at the end of December, compared to 4,650 at the end of May.