SALT LAKE CITY — The Church of Jesus Christ of Latter-day Saints on Thursday repealed rules unveiled in 2015 that banned baptisms for children of gay parents and made gay marriage a sin worthy of expulsion.

The surprise announcement by the faith widely known as the Mormon church reverses rules that triggered widespread condemnations from LGBTQ members and their allies and marked a jarring shift from the religion’s push to carve out a more compassionate stance on LGBTQ issues.

The rules banned baptisms for children living with gay parents until they turn 18, disavowed same-sex relationships and received approval from global church leaders.

With the change, children of gay parents can now be baptized as long as their parents approve the baptisms and acknowledge that the children will be taught church doctrine, the church said in a statement from its highest leadership group called the First Presidency.

The faith said in a statement that it is not changing its doctrinal opposition to gay marriage and still considers same-sex relationships to be a “serious transgression.”

But people in same-sex relationships will no longer be considered “apostates” who must be kicked out of the religion, the statement said.

“The very positive policies announced this morning should help affected families,” the leaders said in the statement. “In addition, our members’ efforts to show more understanding, compassion and love should increase respect and understanding among all people of goodwill.”

The change marks the biggest move yet by church President Russell M. Nelson, who has made a flurry of changes to how the church functions since taking over the faith in January 2018.

Troy Williams with the LGBTQ-advocacy group Equality Utah called the announcement a big step forward.

“Clearly this is a great development for the church,” he said. “I think this will go a long way toward healing Latter-day Saint families that have LGBT members.”

FOLLOW NBC OUT ON TWITTER, FACEBOOK & INSTAGRAM