When a state legalizes same-sex marriage, it leads to a drop in teenage suicide rates, a new study has found. The latest research looking into the impact that the policy has on the health of young people found that the effect is seen not only among those who identify as LGBTQ, but all teenagers alike.

Published in JAMA Pediatrics, the study investigated how the legalization of same-sex marriages across 32 of the 35 US states that have so far signed it into law affected the suicide rate among over 760,000 students between the years of 1999 and 2015. This was then compared to the 15 states that have not legalized it. Taking into account other conflicting factors, they found that the teen suicide rate fell by 7 percent among all students, and by an even more impressive 14 percent amongst LGB students.

“These are high school students, so they aren’t getting married anytime soon, for the most part,” explained Julia Raifman, who led the study, in a statement. “Still, permitting 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.”

Suicide has long been recognized as a significant threat among teenagers, and is currently the second leading cause of death for people aged between 10 and 24. This issue is often magnified for those who identify as LGBTQ, where 29 percent reported attempting suicide in the last year compared to 6 percent of heterosexual teens. While the rate of mental health disorders among the LGBTQ population is usually reported as higher than among heterosexuals, it is actually similar to those from other minority groups.

It is thought that the negative attitudes towards LGBTQ people are the driving force behind this, putting teenagers identifying as LGBTQ at an increased risk of violence compared to straight teenagers. This ranges from bullying to harassment and physical assault. Those youths coming from “highly rejecting” families are 8.4 times more likely to attempt suicide than those LGB teenagers with more accepting relatives, for example. But it is important to note that suicide is actually still rare, and the majority of people do get through the dark times.

While there was a clear and undeniable decline in the suicide rates among teenagers in those states that legalized same-sex marriage, the researchers were unclear whether this was down to the political campaign surrounding the legalization, which may have helped teens see that they were not alone, or a direct result of the policy itself.

“We can all agree that reducing adolescent suicide attempts is a good thing, regardless of our political views,” said Raifman. “Policymakers need to be aware that policies on sexual minority rights can have a real effect on the mental health of adolescents. The policies at the top can dictate in ways both positive and negative what happens further down.”