Senators scrambled for the two-thirds majority now needed to pass the measure after lengthy last-minute rewrites forced lawmakers to miss procedural deadlines.

This latest hurdle is one of many that could cause the regulation in Senate Bill 423 to go up in smoke. Even if the measure clears the Senate, House Republican leaders have said they don’t support the Senate’s overhaul attempt and remain ardent supporters of banning the medical marijuana altogether.

Medical marijuana was overwhelmingly approved by voters in 2004 and remained a mostly small homegrown operation until two years ago, when an explosion of high-profile businesses and cardholders prompted worries in communities across the state. Lawmakers from both parties entered the session promising to do something about industry, which has been targeted in recent federal raids.

But the House’s measure to repeal the medical marijuana law has stalled in the Senate. And the House, where Republicans leaders were focused on repeal from the start, never advanced a regulation bill that was two years in the making and initially had the blessing of both law enforcement and the medical marijuana industry.

Lawmakers are now facing the prospect of deadlock and inaction — raising the specter that the medical marijuana industry could continue to grow with few regulations even though leaders from both parties have said the status quo is unacceptable.

Adding to the uncertainty is a series of raids on medical marijuana businesses earlier this month as part of an 18-month federal investigation into drug trafficking and tax evasion. No charges have been filed, but federal and state authorities executed 26 search warrants and four civil seizure warrants across the state.

The supermajority vote required Wednesday prompted minority Democrats — on the losing end of many votes this session — to bargain for concessions. Republicans supporting the overhaul will need around 10 votes from across the aisle to advance the measure.

Early in the day Wednesday, Democrats successfully advanced an amendment to make the Department of Agriculture the marijuana regulatory authority instead of the Public Service Commission. Supporters argued putting the elected PSC in dramatically change the politics of the commission.

Sen. Steve Gallus, D-Butte, said he also wanted to see Republicans compromise on other unrelated issues — such as school funding — before Democrats would give their support to the Republican-backed measure at day’s end.

“The right thing to do for the people that we represent and for our constituents and for Montana families is to use this as a lever to get what we need and deliver what we have to, to the people who voted for us,” Gallus said.

Senate President Carol Williams said such a deal is in the works with Republican leadership and encouraged Democrats to trust her leadership.

And some Democrats said they won’t support the stringent regulation at all, arguing it is too restrictive and will deny legitimate patients access to the drug.