When Utah Gov. Gary Herbert proposed a new rule banning licensed therapists from practicing LGBTQ conversion therapy on minors this week, it was supported not only by LGBTQ advocates, but also the Church of Jesus Christ of Latter-day Saints (LDS).

The support of the LDS church, formerly known as the Mormon church, didn’t come easily. The process of banning conversion therapy has taken months of back-and-forth between church leaders, the LGBTQ community and state policy makers. As recently as a month ago, the church opposed the governor’s rule change.

Troy Williams, the executive director of LGBTQ advocacy group Equality Utah, tells TIME that the ban is significant because Utah is “ground zero” for conversion therapy. The idea that sexuality could be changed has pervaded among LDS members since at least the 1960s, when LDS apostles published Miracle of Forgiveness, which described gay sex as a “crime against nature” and said that sexual orientation could be changed through prayer. Researchers at Brigham Young University, which is owned by the church, allegedly used electric shock therapy to attempt to cure homosexuality in the 1970s.

“We are pleased that the new rule will mirror the legislation that was drafted and introduced earlier this year. We have no doubt the adoption of this rule will send a life-saving message to LGBTQ+ youth across our state,” Williams said in a statement released after the announcement.

When the rule goes into effect, as early as January 2020, Utah will be the 19th state to ban the practice.

While the LDS church has repeatedly affirmed that it does not condone or implement conversion therapy—which GLAAD defines as “any attempt to change a person’s sexual orientation, gender identity or gender expression”—LDS teachings are still regarded as largely conservative on LGBTQ issues. The church has described same-sex couples who marry as apostates; until this year, their children could not be baptized without approval from church leadership. Last month, LDS President and Apostle Dallin H. Oaks described gender as “biological sex at birth”—a definition which excludes people who do not identify with the gender they were assigned at birth.

Asked for comment, the LDS church pointed TIME to its statement in support of the governor’s proposed ban.

LGBTQ advocates strongly tied the ban to efforts to address the rising suicide rate in Utah and prominent youth suicides. In the last three years, the church has invested in suicide prevention resources and campaigns.

Bryan Schott, the managing editor of UtahPolicy.com who has spent two decades covering politics in Utah, says that two major factors may have led the church to change its mind. Schott says that there’s growing concern about suicide in Utah, which has the sixth-highest suicide rate in the nation, and the LGBTQ advocates raised compelling evidence that attempts to change sexual orientation harms LGBTQ youth. Additionally, the rule now explicitly leaves room for discussions of morality.

“When they are presented with evidence, they can be very reasonable,” Schott says of the LDS church.

It was not always clear that Utah would ban conversion therapy. A first attempt to ban the practice appeared as a bill in the Utah legislature in winter 2019, but stalled after it was radically limited by social conservatives on the state House Judiciary Committee. With the alterations, the legislation would only place narrow limitations on healthcare practitioners, banning them from promising to change sexual orientation, or administering painful treatments—such as electric shock therapy. Negotiations between the governor’s office, LGBTQ advocates and the LDS church continued until the governor proposed a new solution: He offered to amend the state’s professional licensing rules to bar conversion therapy by licensed counselors, a move that would not require legislators’ approval.

The LDS church had chosen to neither oppose nor support the legislative bill banning the practice earlier this year. However church leaders at first opposed Herbert’s proposed rule change. In October, the church said that it is “ambiguous in key areas and overreaches in others.” It sent a letter to the state Division of Occupational and Professional Licensing, which was obtained by the Salt Lake Tribune. The letter argued that the ban’s definition of gender identity change was too broad and that it could curb what it describes as legitimate therapeutic practices.

It became clear that the church had reversed it position on Tuesday when it endorsed the rule change after the governor added language that made clear that patients could continue to discuss “moral or religious beliefs or practices” with a healthcare provider. A press release from the governor’s office announcing the conversion therapy ban included a statement from Marty Stephens, director of government relations for the LDS church. Stephens thanked the governor, his staff and the Division of Occupational and Professional Licensing for “finding a good solution which will work for all concerned.”

Williams says that part of the effort to pass the enact the ban in Utah was maintaining an an “active dialogue” with representatives from the LDS church. Williams says that while there are still religious conservatives in Utah who strongly support conversion therapy, he felt encouraged by the outpouring of support he received from LDS families.

“The most powerful protective factor we have to prevent suicide are strong family bonds. And when those family bonds are fractured by these kind of culture wars, then young people are at risk,” says Williams.

When asked if he felt the rule changes went far enough to limit conversion therapy, Williams insists that it went far as legally possible without infringing on individual rights.

“They’re not exceptions, they’re clarifications. That’s the important part,” Williams says of the passage. “And yeah, clergy are exempt. Life coaches are also exempt. Because the state doesn’t regulate churches, the state doesn’t regulate life coaches… right now, the state only regulates state licensed therapists. Right now, a lot of people are coming to me and saying that’s not enough. That’s what’s consistent with the first amendment and the Constitution of the United States.”

Williams says that the inclusion of the provision clarifying that that the rule likely was the reason the LDS church was willing to approve of the ban. However, he says that it does not impact the effectiveness of the ban, noting that LGBTQ rights advocates had worked with the Human Rights Campaign to ensure the language was “consistent with the national LGBTQ movement.”

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.