“Many of these mass shootings are angry suicides,” says James Densley, professor of criminal justice at Minnesota’s Metropolitan State University.

Densley is part of a team that is working on a database of more than 150 mass shootings that took place between 1966 and 2018. His data won’t be public until January, but he said about half the attackers in his sample had demonstrated signs of feeling suicidal before they hurt others. A different set of researchers who analyzed 41 school shooters for the Secret Service and Department of Education found that 78 percent had a history of thinking about or attempting suicide.

“We’ve even talked to a couple of people who tried to kill themselves but failed and then launched an attack because they were hoping police would kill them,” said Marisa Randazzo, a former chief psychologist for the Secret Service who now consults on active threat assessment with schools and other organizations.