SALT LAKE CITY -- The Utah State Legislature voted to replace Proposition 2, the medical cannabis ballot initiative approved by voters last month.

The Republican-dominated Utah House of Representatives approved the substitute bill by a vote of 60-13. The Utah State Senate voted 22-4 to pass it.

The bill was signed by Governor Gary Hebert, creating a state-run medical cannabis program.

"This is a historic day. With the passage of the Utah Medical Cannabis Act, Utah now has the best-designed medical cannabis program in the country. Working with trained medical professionals, qualified patients in Utah will be able to receive quality-controlled cannabis products from a licensed pharmacist in medical dosage form. And this will be done in a way that prevents diversion of product into a black market," the governor said in a statement.

"This is an example of how collaboration makes Utah the best-managed state in the nation. Proponents and opponents came together to honor the voice of Utah voters who compassionately stood up for Utah patients."

It came after hours of debate in a special session of the legislature.

"This agreement is a landmark day for our state and that we’re helping people," said House Speaker Greg Hughes, R-Draper.

Prop. 2 was approved by 53% of voters in a contentious campaign that saw political and cultural forces working against it. Seeing that it was going to pass, Speaker Hughes convened legislative leadership, opponents like the Utah Medical Association and The Church of Jesus Christ of Latter-day Saints and Prop. 2's sponsors, the Utah Patients Coalition and Libertas Institute, to negotiate a "compromise bill."

The bill's sponsors said they had to engage in talks for fear the legislature would gut the citizen referendum. It's led to a fracturing amongst medical cannabis advocates, some of whom have insisted that Prop. 2 be enacted as-is.

"We knew this was the reality of politics, especially on this issue," Alex Iorg of the Utah Patients Coalition told FOX 13 after the votes. "We are optimistic, but there is still some work that needs to be done."

In hours of debate in both the House and Senate, lawmakers clashed over whether the substitute bill was good policy or they were usurping the will of the voters.

"I am asking the members of this body to stay in our lane," said Rep. Rebecca Chavez-Houck, D-Salt Lake City. "The voters have spoken."

But some like Rep. Karianne Lisonbee, R-Clearfield, argued that their districts opposed Prop. 2.

"I am mindful of the people’s voice, I’m mindful of patients’ needs and I am mindful of legitimate public safety concerns," she said.

There was also pushback in the House over the LDS Church's involvement in the negotiations over the substitute bill. House Minority Leader Brian King, D-Salt Lake City, suggested that if lawmakers are told by the Church what to think about a bill and believe that's the end of debate -- they ought not be in the legislature.

Sen. Jim Dabakis, D-Salt Lake City, made a pair of attempts to block the bill from passing by replacing it with a marijuana decriminalization bill and copying Rep. Chavez-Houck's substitute to allow Prop. 2 to stand.

"To say we have special knowledge, we know better, we will overthrow the will of the majority of the people because we have special power I think is a level of arrogance that we ought not to display to the rest of the state," Sen. Dabakis said in a fiery speech.

Sen. Brian Zender, R-Murray, indicated he still had unease with medical cannabis being implemented at all.

"I fear we are sacrificing the best medical science on the altar of heartfelt compassion," he said.

Together for Responsible Use and Cannabis Education has threatened a lawsuit over the legislature overriding Prop. 2, as well as the LDS Church's involvement in negotiations. TRUCE has pressed the legislature to enact medical cannabis bills for years until they got the initiative.

On Monday, TRUCE founder Christine Stenquist told FOX 13 that lawsuit was going to be filed.

"What I think about the process? It’s a sham. It’s an absolute sham. When you sit there and you make the citizens of Utah jump through the hoops you jump through to pass an initiative and the first business day you undermine and remove our voice? That’s a problem," she said.

In a statement released by the LDS Church on Monday night, Marty Stephens, the Church's director of Community and Government Relations (and a former Utah House Speaker) was pleased with the vote.

"The Church of Jesus Christ of Latter-day Saints welcomed the opportunity to participate in a broad community effort to alleviate pain and suffering. Today the passage of the Utah Medical Cannabis Act once again shows how organizations with diverse interests can come together to resolve difficult issues for the benefit of those who suffer while simultaneously protecting our children. We thank the leadership of the state, the medical professionals, patients advocates, law enforcement and the many others who made this effort possible," he said.

Under Utah law, the state legislature has the authority to replace or modify ballot initiatives. Many of the same lawmakers who voted on this replacement bill were re-elected on the same ballot that voters approved Prop. 2.

The Libertas Institute insists that what lawmakers have passed is "90% of what voters approved." However, some provisions are stripped out and regulations are stricter on medical cannabis. For example, "grow your own," if you live more than 100 miles from a dispensary, is out; patients must purchase through a state-run dispensary or a select amount of privately-run facilities; the patient list has been modified; but nurse practitioners, physician assistants and high-ranking social workers added to the list of those who can recommend it.

Read the bill here (refresh the page if it doesn't immediately load):