PROVO, Utah — The leader of The Church of Jesus Christ of Latter-day Saints is reaffirming that the religion must stick to its opposition of gay marriage because God's law states that marriage should only be between a man and a woman.

Church president Russell M. Nelson also said Tuesday in a speech to students at the church-owned Brigham Young University that a 2015 policy banning baptisms for children of parents in same-sex relationship was rescinded earlier this year because leaders took note of the "heartache" it caused.

Nelson said the policy was motived by love and tried to prevent friction between the beliefs of gay parents and their children.

The speech follows an ongoing push by the faith, widely known as the Mormon church, to carve out a compassionate stance toward LGBTQ people while opposing gay marriage.

Nelson ascended to president in January 2018 and has been a transformative president for the church. He has made a number of significant policy changes and traveled around the world on ministry trips.

Church presidents are considered prophets by members of the faith.

Follow NBC Out on Twitter, Facebook & Instagram