Global warming is leading more people to commit suicide, a new study says.

Stanford University scientists say they have identified a connection between climate change and mental health, suggesting that abnormally hot temps prompt more suicides.

If trends persist, there could be an additional 21,000 deaths in the US and Mexico alone over the next three decades, according to their study, which was published in Nature Climate Change on Monday.

“When talking about climate change, it’s often easy to think in abstractions,” wrote lead researcher Marshall Burke. “But the thousands of additional suicides that are likely to occur as a result of unmitigated climate change are not just a number, they represent tragic losses for families across the country.”

The study compared suicide rates in abnormally hot months with those in months with average temperatures. Burke and his colleagues looked at five decades of suicides and the temperature when each death took place.

They concluded that other factors, such as unemployment, failed to account for all situations and trends, the San Francisco Chronicle reported.

The authors stress that rising temperature and climate change should not be viewed as direct motivations for suicide. Instead, they point out that temperature and climate may increase the likelihood amid other factors.

“It appears that heat profoundly affects the human mind and how we decide to inflict harm,” said Solomon Hsiang, study co-author and associate professor at the University of California, Berkeley.

Burke added, “Suicide is one of the leading causes of death globally, and suicide rates in the US have risen dramatically over the last 15 years.

“So better understanding the causes of suicide is a public-health priority.”