The Church of Jesus Christ of Latter-day Saints has backed a bill that seeks to protect same-sex marriage but other religious groups remain opposed.

The Church of Jesus Christ of Latter-day Saints, which has nearly 17 million members, backed the legislation in a statement released on Tuesday, a day before the bill cleared a key vote in the Senate with the help of 12 Republican senators.

(Related: Senate advances same-sex marriage bill.)

The church said in its statement that it remains opposed to same-sex relationships but favors equal marriage rights for gay and lesbian couples.

“We believe this approach is the way forward,” the church said. “As we work together to preserve the principles and practices of religious freedom together with the rights of LGBTQ individuals much can be accomplished to heal relationships and foster greater understanding.”

The Respect for Marriage Act seeks to codify the Supreme Court's 2015 ruling in Obergefell that struck down laws and constitutional amendments that defined marriage as a heterosexual union, ushering in nationwide marriage equality. It would strengthen protections on a federal level and require states to recognize all legal out-of-state marriages.

The bill is a priority for Democrats who lost control of the House in the midterms.

The U.S. Conference of Catholic Bishops and leaders of the Southern Baptist Convention continue to voice opposition to the legislation, warning that the bill threatens the liberty of religious organizations.

“The Catholic Church will always uphold the unique meaning of marriage as a lifelong, exclusive union of one man and one woman,” Cardinal Timothy Dolan of New York, chairman of the Catholic bishops' Committee for Religious Liberty, said. “Senators promoting the [Respect for Marriage Act] have claimed that their amended bill 'respects and protects Americans' religious liberties,' but the provisions of the Act that relate to religious liberty are insufficient.”

The Mormon Church has previously supported state laws and constitutional amendments that define marriage as a heterosexual union. Its members heavily contributed to campaigns in support of such bans, including California's Proposition 8.