A pair of advocacy groups in Utah sued Thursday to block a compromise agreement legalizing medical marijuana, accusing the LDS Church of unconstitutional domination and interference involving a process that lead to the gutting of a measure approved by voters.

The lawsuit alleges the revised initiative creates overwhelming obstacles for suffering patients who want to obtain the drug. It also asks a judge to set aside the revision passed by lawmakers and keep the original version that won with 53 percent of the vote in November.

The Church of Jesus Christ of Latter-day Saints didn’t immediately have comment.

The LDS Church has long frowned upon marijuana use because of a key church health code called the “Word of Wisdom,” which prohibits the use of alcohol, tobacco and illegal drugs. However, it previously stood behind the work it did to help craft the compromise before the election that it considers a safer medical marijuana program.

The changes signed into law on Monday ban many marijuana edibles; prevent people from growing their own marijuana if they live far from a dispensary; and narrow the list of eligible medical conditions for which the drug can be obtained. Smoking marijuana wasn’t allowed in the original ballot measure and won’t be permitted under the new version.

The legal challenge isn’t a surprise. The plaintiffs — an organization called Together for Responsible Use and Cannabis Education, or TRUCE, and the Epilepsy Association of Utah — had warned they would sue if the ballot measure was altered. They were upset that the primary organization backing medical pot in the state agreed to the compromise before the election.

Utah law gives state legislators the authority to change the language of laws passed by voters.

Supporters of the compromise, including some advocates of medical marijuana, say it was a key to guaranteeing quick legalization and convincing conservative lawmakers not to repeal the law.

The Utah Patients Coalition, the main medical marijuana group that backed the ballot measure, has said it agreed to the compromise so it could prevent radical changes to the measure after the election and to gain widespread community acceptance. It acknowledged that the LDS Church has a powerful voice in Utah politics.

About two-thirds of the state’s residents belong to the religion and nearly nine in 10 members of the Legislature are members of the LDS Church along with the governor, the lawsuit states.

It says LDS members are taught to follow and trust the direction of their leaders, who opposed the ballot proposal over fears it could lead to broader use of marijuana. As the proposal seemed to gain support, the church agreed to the pre-election deal to allow access for people with serious medical needs.

The lawsuit notes that church lobbyist Marty Stephens told a gathering of local church leaders two days before the Nov. 6 election to “follow the prophet” and vote against the ballot proposition. The Utah Constitution bars any church from dominating or interfering with state functions, the lawsuit says.

Utah Gov. Gary Herbert signed the revised compromise law Monday after he called a special legislative session. He didn’t immediately have comment.

Patients can now use medical marijuana legally in Utah but likely won’t be able to buy it legally in-state until at least 2020, officials said.

The state will need time to build a database to start issuing patients medical-cannabis cards, and to grant licenses for dispensaries.