When the Supreme Court made same-sex marriage federal law in June of 2015, the justices probably had little idea they were also helping to prevent teen suicide, but it appears that is what they did. A new study published in JAMA Pediatrics finds that state laws legalizing same-sex marriage are associated with a significant reduction in the rate of suicide attempts among high school students — especially those who are gay, lesbian and bisexual.

The study's lead investigator, Julia Raifman, explained the connection in a statement, “…[Legalizing] same-sex marriage reduces structural stigma associated with sexual orientation. There may be something about having equal rights — even if they have no immediate plans to take advantage of them — that makes students feel less stigmatized and more hopeful for the future.”

Six percent of heterosexual teens attempt suicide; the risk of suicide among gay, lesbian and bisexual high school students is almost five times that — 29 percent.

The Johns Hopkins Bloomberg School of Public Health researchers used data from the Youth Risk Behavior Surveillance System, a survey supported by the Centers for Disease Control and Prevention. The data included 32 of the 35 states enacting same-sex marriage policies between January 1, 2004 and January 1, 2015. In order to capture trends in suicide attempts in relation to the change in policies in these states, the researchers used data five years before the first same-sex marriage policy went into effect in Massachusetts — from January 1, 1999 to December 31, 2015.

Suicide attempts among adolescents requiring medical attention increased nearly 50 percent between 2009 and 2015. Six percent of heterosexual teens attempt suicide; the risk of suicide among gay, lesbian and bisexual high school students is almost five times that — 29 percent.

States with same-sex marriage legalization policies had a seven percent reduction in suicide attempts among high school students in general, with a 14 percent reduction in suicide attempts among gay, lesbian and bisexual adolescents. The effects lasted for at least two years. States with no same-sex marriage laws saw no reduction in suicide attempts among high school students.

Despite the large reduction in suicide attempts among gay, lesbian and bisexual high school students, this population still attempts suicide at higher rates than their straight peers. “It's not easy to be an adolescent, and for adolescents who are just realizing they are sexual minorities, it can be even harder — that's what the data on disparities affecting gay, lesbian, and bisexual adolescents tell us,” says Raifman.

There are few programs aimed at helping students who are sexual minorities. Schools and medical providers need to understand that students who are sexual minorities are at higher risk and be on high alert.

While the Johns Hopkins study found that legalizing same-sex marriage appears to reduce suicide attempts, the opposite may also be true: policies that take away rights or add to stigma could have the opposite effect, so policymakers need to be aware that their policies on the rights of sexual minorities can have a big effect — both positive and negative — on adolescents' mental health. Says Raifman, “We can all agree that reducing adolescent suicide attempts is a good thing, regardless of our political views.”