The Mormon Church on Thursday said that it was rolling back its controversial 2015 policy that allowed officials to oust married gays and their children.

The Church of Jesus Christ of Latter-day Saints' changes to the Mormon handbook classified gay married Mormons as “apostates” and prohibited the children of such marriages from blessing or baptism until age 18 and only if they disavow same-sex relationships. Classifying same-sex couples as “apostates” meant they could be excommunicated.

The church said in a news release that the changes are “effective immediately” and “should help affected families.”

“Previously, our Handbook characterized same-gender marriage by a member as apostasy,” the church wrote. “While we still consider such a marriage to be a serious transgression, it will not be treated as apostasy for purposes of Church discipline. Instead, the immoral conduct in heterosexual or homosexual relationships will be treated in the same way.”

In a tweet, the church said that the new policy would “show more understanding, compassion and love” to gay and lesbian couples.

The Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, cheered the news, calling the church's move a “welcome change that moves the church to a day where LGBTQ Mormons can see themselves affirmed and included in their faith and community.”

Critics of the 2015 policy said that it harmed the children of gay couples and those who identify as LGBT. In Utah, where a majority of the population is Mormon, suicide is the leading cause of death for children 10 to 17.