Late Tuesday, Utah became the 32nd state to legalize medical marijuana use.

Utah has a complicated relationship with marijuana use when it comes to the Church of Jesus Christ of Latter-day Saints, which is hugely influential in the state. More than 60 percent of the state’s 3 million residents are LDS members.

ALSO: Ontario voters lift ban on marijuana sales

Prop. 2 had strong support in the weeks before the election. But then the LDS church starting running radio ads warning that medical legalization is the first step toward full legalization, which is at odds with a faith that teaches its followers to stay away from alcohol, coffee, tobacco and illegal drugs.

Under Utah law, lawmakers are able to amend or repeal voter-approved ballot measures, so the LDS church and proponents of Prop. 2 reached an agreement before the election that will amend the language to state that residents are banned from growing their own weed while trying to establish a state-run medical marijuana distribution network.

Smoking marijuana will likely remain illegal, but sick people could be able to eat cannabis-infused foods or use vape pens.

RELATED: Weed wins the midterms: Michigan, Missouri, Utah legalize marijuana

Schweich at the Marijuana Policy Project, previously told USA TODAY, “There's a lot of voters who support marijuana in principle but didn't want to go in opposition of the LDS church. The important thing about Utah is that we have made a compromise.”

In other elections around the country Tuesday, Missouri also legalized medical marijuana, while Michigan became the first Midwestern state to legalize it for recreational use.