Researchers say tolerant marriage laws reduce the number of suicides of LGBTQ teens by improving how they feel about themselves and society in general.

Suicide is the second leading cause of death for people between the ages of 15 and 24 in the United States.

However, adolescents who identify as gay, lesbian, bisexual, or transgender are at even greater risk of self-harm.

National data from 2015 compiled by the Youth Risk Behavior Surveillance System (YRBSS) reveal that more than 29 percent of gay, lesbian, bisexual, and transgender high school students reported attempting suicide in the previous 12 months. That compared with only 6 percent of heterosexual students.

But there’s hope, at least on one horizon.

According to a new study published in JAMA Pediatrics, same-sex marriage legalization leads to an overall decrease in adolescent suicide attempts.

Read more: Get the facts on suicide and suicidal behavior »

Researchers used YRBSS data from 1999 through 2015 of more than 750,000 students to identify how suicide statistics in states that legalized gay marriage compared with those that didn’t.

“After same-sex marriage laws were implemented,” the researchers wrote, “the proportion of high school students reporting suicide attempts in the past year decreased by 0.6 percentage points, equivalent to a 7 percent decline.”

Adolescents who identified as gay, lesbian, bisexual, or transgender had an even more precipitous drop in reported suicide attempts of 4 percentage points. That was equivalent to a 14 percent decline compared with heterosexual students.

The study estimates that, following this trend, “same-sex marriage policies would be associated with more than 134,000 fewer adolescents attempting suicide” every year.

Julia Raifman, ScD, the study’s lead author, and a postdoctoral fellow at the Johns Hopkins Bloomberg School of Public Health, told Healthline that they believe that same-sex marriage policies may have effectively reduced stigma toward LGBTQ youth by peers, teachers, and parents.

Stigma based on sexual orientation can broadly mean an array of behaviors, but tends to include labeling, prejudice, and stereotyping.

It can have a whole range of negative effects on LGBTQ individuals, including distress, anxiety, depression, and increased suicide risk.

The correlation between same-sex marriage legalization and reduced suicide attempts in adolescents isn’t crystal clear, but study authors say it does make a compelling argument for the benefits of such legislation.

Additionally, Raifman explains that studies can also offer insights into other facets of public health concerning the LGBTQ community, including how gay marriage policies affect disparities in HIV among men who have sex with men.

Read more: The lasting effects of bullying »

LGBTQ rights advocates say the study is incredibly important.

“Suicide is a public health issue. This piece of research is a very positive tool in our toolkit that will support future efforts to link the legislation of positive regard and equality to the improvement of the lives and health of LGBTQ people,” said David W. Bond, vice president of programs at The Trevor Project, a nationwide crisis intervention and suicide prevention service for LGBTQ youth.

He also echoes Raifman’s conclusion about the results of the research.

“Marriage equality can likely be seen as an indicator of acceptance, replacing the rejection that very significantly contributes to suicidality,” he told Healthline.

Same-sex marriage in the United States has been legal on a federal level since 2015. In the landmark case Obergefell v. Hodges, the Supreme Court voted in a 5-4 decision that same-sex couples had the fundamental right to marry and required all states to begin issuing marriage licenses to same-sex couples.

However, the issue remains contentious. With a Republican administration in office, the question of LGBTQ — particularly transgender rights — has become more visible.

This week, President Trump reversed an initiative set forth under President Obama that allowed students in public schools to use bathrooms of their choice — not based on their sex.

Meanwhile, North Carolina’s now infamous “bathroom bill,” which also designates bathrooms only be used by people based on their “biological sex,” is still being debated.

Numerous outlets reported a dramatic spike in calls to transgender suicide hotlines, following the passing of the bill in March 2016.

Janson Wu, executive director of GLAD, a legal advocacy group for the LGBTQ community, says that directives like this can be harmful, particularly to adolescents.

“When we ask lawmakers to pass a law, we not only explain why it is necessary to fix a concrete problem, such as discrimination,” he told Healthline, “we also impress upon them the critical importance of sending a message of inclusion and support to young people.”

Wu also stressed the importance of the recent research, saying that it underscores the “impact of laws that protect and affirm the equality [and] dignity of LGBT people.”