Researchers say American laws allowing same-sex marriage are associated with fewer suicide attempts among teenagers.

They came to that conclusion by analyzing rates among more than 750,000 public high school students across most of the United States between 1999 and 2015 — the year that the Supreme Court made gay marriage legal throughout the country. That included data from 32 states whose governments changed to permit gay marriage and 15 that did not. According to the Journal of the American Medical Association, the new state rules about same-sex marriage were associated with 7 percent decreases in suicide attempts.

Read: Signs of Depression vs. Dysthymia

“The effect of that reduction was concentrated among adolescents who were sexual minorities,” the association says. “The authors estimate same-sex marriage policies would be associated each year with more than 134,000 fewer adolescents attempting suicide.”

Suicide is the second leading cause of death among people between the ages of 10 and 34, after unintentional injuries, according to the U.S. National Institute of Mental Health. And young gay, lesbian, bisexual and transgender people are more likely to contemplate or attempt suicide than their straight peers: The Centers for Disease Control and Prevention say those LGBT kids in grades 7 through 12 are at greater than double the risk of attempting suicide.

Although the study, in JAMA Pediatrics, notes that the results do not explain precisely how same-sex marriage policies affect teen suicide attempts, society’s changing attitudes toward the LGBT community offer clues.

Previous research shows that gay and bisexual people are more likely to face childhood sexual trauma and negative social interactions, like bullying, as well as engage in risky behaviors. Those factors put them more at risk for mental health issues, including depression and anxiety disorders. And this latest study connects policies against gay marriage with those changing views within society: “Policies preventing same-sex marriage are a form of structural stigma because they label sexual minorities as different and deny them benefits associated with marriage,” the Journal of the American Medical Association says.

Indeed, the CDC has noted that gay, lesbian and bisexual students who did not endure “homophobic teasing” were at the lowest risk level for suicidal feelings — even lower than their heterosexual classmates.

“As countries around the world consider enabling or restricting same-sex marriage, we provide evidence that implementing same-sex marriage policies was associated with improved population health,” the study says.

See also:

The Difference Between Psychologist and Psychiatrist

One in Six Adults Take Psychiatric Drugs