A Michigan judge Thursday has halted state regulators' attempts to shut down 98 medical marijuana businesses.

The businesses were about to face cease and desist letters Monday, Sept. 17, from the state's licensing bureau.

Instead, Court of Claims Judge Stephen Borrello has granted a temporary restraining order that prevents that from happening.

State officials had issued an emergency rule Tuesday, Sept. 11, that allowed 108 medical marijuana businesses that were temporarily operating to continue to stay open until December without a license. But for 98 others who hadn't filed certain paperwork by June 15, they would be facing closure next week.

Denise Pollicella of Cannabis Attorneys of Michigan argued against the shutdown on behalf of her client, a medical marijuana business that she declined to disclose, in the case Montrowe vs. Department of Licensing and Regulatory Affairs.

"They gave us the relief I was least expecting," Pollicella said.

Had state officials executed plans to close down 98 businesses, Pollicella said it would have caused nearly 1,000 people to lose their jobs, bankruptcies and businesses would have had to divest millions of dollars worth of marijuana products.

Bureau of Medical Marihuana spokesman David Harns said the bureau had received a copy of Judge Borrello's order and was taking it under review.

The major issue Pollicella argued was the nature of the state's emergency rule, which called for businesses to have submitted certain paperwork by June 15. That was three months ago, Pollicella said, and left businesses no recourse this week.

Pollicella said her client filed their application with the state in January and didn't hear back until April. The business had local approval, but hadn't filed the second part of the application by June 15.

Pollicella said she tried to work with the state before filing a lawsuit -- but they wouldn't budge.

"Filing a lawsuit was the last thing I wanted to do," Pollicella said.

Pollicella said she believes the judge understood the peril that faced businesses who would have been forced to suddenly shut their doors.

"I'm relieved someone finally looked at these facilities like businesses," Pollicella said. "What the judge understood ultimately is that this is confusing, this is complex and for the most part it's not malicious. I don't doubt -- and I agree with the state -- that there are people in this industry who are not good actors."

Medical marijuana businesses now have until Dec. 15 to obtain a state license. After that date, all product sold at a provisioning center would have to be grown, processed, tested and transported at a licensed business.

Medical marijuana has been legal in the state since 2008, thanks to a vote of the people. The 2008 law established the caregiver model, but did not establish a regulatory framework for businesses -- which is why dispensaries have been operating in legal limbo for the past decade.

In 2016 the legislature created new laws to formally establish and oversee medical marijuana businesses. The first licenses under those new laws have been issued this summer -- and the state was trying to hold businesses to a deadline for compliance.

-- Amy Biolchini is the marijuana beat reporter for MLive. Contact her with questions, tips or comments at abiolch1@mlive.com.