The Church of Jesus Christ of Latter Day Saints has formally aligned itself with opponents of a federal directive granting transgender students the right to use the restroom or locker room that aligns with their gender.

After ongoing efforts to find compromise with the LGBTQ community, the LDS (Mormon) Church joined six other religious groups in filing an amicus brief in G.G. v. Gloucester County School Board — the case brought by transgender teen Gavin Grimm that’s headed to the U.S. Supreme Court next month.

The LDS Church didn’t initially take a position on the directive, instead making a vague call for “reasonable solutions.” It’s earlier support of a state law barring anti-LGBTQ discrimination in housing and employment while protecting “religious freedom” signaled to some that the church was moving toward a middle ground.

“This movement arose after centuries of ridicule, persecution and even violence against homosexuals,” church leader Neill F. Marriott said at the time. “Ultimately, most of society recognized that such treatment was simply wrong.”

Supporters of the directive granting transgender students access to sex-segregated facilities that match their gender argue that the guidelines are intended to prevent ridicule, persecution, and even violence against transgender students.

“The brief concludes by arguing that, instead of imposing an outcome Congress did not intend, the Supreme Court should allow Congress and state legislatures to reach compromises where transgender persons can be appropriately accommodated without infringing on the free exercise of religion, while seeking fairness for all,” church spokesman Eric Hawkins told the Salt Lake City Tribune. “Sustainable results will be more likely achieved if citizens and lawmakers are left free to address gender identity in ways that preserve the nation’s priceless heritage of religious freedom.”

But Neca Allgood, a Mormon whose son is transgender, told the Tribune she doesn’t see it as an issue of religious freedom.

“I was not at all clear on why the church would choose to take a position on that interpretation of Title IX,” Allgood said. “It doesn’t seem like a religious liberty question to me.”

According to a 1995 LDS Church proclamation on the family, “gender is an essential characteristic of individual premortal, mortal and eternal identity and purpose.”

The other religious groups were the United States Conference of Catholic Bishops; Union of Orthodox Jewish Congregations of America; National Association of Evangelicals; the Ethics and Religious Liberty Commission of the Southern Baptist Convention; The Church of Jesus Christ of Latter-day Saints; The Lutheran Church–Missouri Synod; and Christian Legal Society.

And though no Muslim or Sikh groups signed onto the brief, it attempted to include perspectives on the immutability of sex from Islam and Sikhism.

“As these statements show, many religions share a common understanding of gender,” the brief concluded. “From the religious perspective, humans are created by God. Personal identity as male or female is an immutable aspect of human nature that reflects divine design.”