Singer-songwriter Miley Cyrus said she stopped attending church because her gay friends weren’t accepted and were forced to undergo conversion therapy.

“I had some gay friends in school,” Cyrus told Hailey Bieber during an episode of “Bright Minded,” Cyrus’ recently launched Instagram show. “The reason why I left my church is that they weren’t being accepted. They were being sent to conversion therapies.”

Conversion therapy refers to the debunked practice of trying to change a person’s sexual orientation or gender identity and is associated with an increase in suicidal thoughts, drug abuse and depression among LGBTQ teens. The practice has been condemned by major medical associations, like the American Psychological Association and the American Medical Association, and outlawed by 20 states, including Virginia, which became the first Southern state to prohibit conversion therapy this month.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Cyrus, who has said she is attracted to people regardless of their gender identity and came out as pansexual in 2015, added that she also struggled with organized religion because of her own sexuality.

“I was also brought up in the church in Tennessee at a time in the ‘90s, so it was a less accepting time with all that,” Cyrus, who was raised Christian and identified as such throughout her childhood and young adulthood, said. “I had a hard time with me finding my sexuality, too.”

Hailey Bieber, a model and the wife of singer Justin Bieber, identifies as a devout Christian. During her conversation with Cyrus, Bieber said her faith has changed over the years and encouraged Cyrus to “explore” her relationship with religion.

“I believe that Jesus is about loving people, no matter where they are in life,” Bieber said. “I’ve always had a hard time with church making people feel excluded and not accepted, and they can’t be a part of it because of what they believe in and who they love.”

Bieber’s response appeared to resonate with Cyrus, who said she was open to reconsidering religion.

“So I think now you telling me that I’m allowed to redesign my relationship with God as an adult and make it how it feels most accepting to me would make me feel so less turned off by spirituality,” Cyrus said.

A majority of all religious groups in the United States are in favor of laws that protect LGBTQ people from discrimination in jobs, housing and public accommodations, according to a March 2019 poll from the nonprofit Public Religion Research Institute.

However, support for LGBTQ protections remains relatively low among evangelical Christians, particularly those who identify as Republican. The poll found that 47 percent of white evangelical Republicans support LGBTQ protections, compared to 58 percent of white evangelical independents and 71 percent of white evangelical Democrats.

Follow NBC Out on Twitter, Facebook & Instagram