Connor Betts, 24, who shot and killed nine people in Dayton, Ohio, before police killed him, was a deeply troubled young man. He had a history of violence against girlfriends and fantasized about murder, keeping a "hit list" of people he wanted to target.
High school classmates said that school officials were aware of his behavior years ago, and that as a freshman, he was missing from school for months after police one day took him from a school bus.
Details of his past are still emerging, and school officials did not respond on Tuesday to questions about his disciplinary record during his school years. Federal authorities said they are investigating last weekend's shooting as a potential domestic terrorism case because it is possible "violent ideologies" were behind the attack.
Such mass shootings at the hands of disaffected young men - including an attack just hours earlier in El Paso, Texas, where a 21-year-old is accused of killing 22 people on Saturday - illustrate the difficulties of tracking people who have made dangerous threats.
President Donald Trump and Republican leaders have made "red flags" such as mental illness, violent crimes or domestic attacks a priority for identifying people who should not be allowed to have guns, saying such warnings could prevent attacks better than gun control efforts. Several states have passed laws limiting access to guns when authorities receive warnings. But some young people, including those responsible for or accused of some of the nation's worst mass shootings, have shown clear warning signs and still have fallen through the cracks.
For "red flags" to work, someone has to raise them.
The FBI examined 63 active shooters who opened fire between 2000 and 2013, and all had displayed some worrisome behaviors beforehand that people around them had noticed, often expressions of a desire to commit violence. But in most cases, people who saw these behaviors responded by talking to the person directly or doing nothing, the study found.
For the attackers who were 17 or younger, teachers and students were more likely than family members to notice these behaviors. For the older attackers, spouses or domestic partners were the most likely to spot them. The study concluded that posed a problem: Those most likely to spot dangerous warning signs often feel loyalty to the attacker, refuse to believe they could commit violence or fear what would happen if they reported the issue.
And, although the United States has been grappling with school shootings for two decades, threat assessment and mental health counseling in U.S. schools is still uneven.
Some of Betts' classmates from Bellbrook High School said they believe his case was not handled well, and they remember feeling as if school officials did not take their concerns about him seriously.
Taylor Gould said she and others in the community knew long ago that something was wrong with Betts, and "they all could have done more to intervene."
At a sleepover with Betts' sister, Megan - who was among those killed during his rampage - and five other girls in middle school, Gould said, Betts pushed her up against a wall and choked her. He only stopped when the other girls, Megan included, yelled at him.
"There were a lot of telltale signs that he was a psychopath, but people didn't pay attention because people in this town care more about sports than mental health," Gould said.
Gould said she tried to take her own life when she was a sophomore in high school, and when she returned after a 10-week leave of absence, she felt alone and overwhelmed.
"Nobody cares about what it's like when we come back from treatment," she said. "You just have to get through it."
She imagines Betts felt a similar way when he returned from his time off school.
"I'm sure when he came back to school, all he felt was pressure," Gould said. "Someone should have been monitoring him."
Schools and workplaces are increasingly creating systems to identify and address people who pose threats with the clear purpose of raising red flags before a violent act.
Virginia, Maryland, Florida, Texas and at least 13 other states, so far, have mandated threat assessment programs in schools to identify students who are troubled and have made some threat of violence.
But those programs usually end at graduation. Troubled students who have been monitored and counseled as teens are often on their own as adults.
"So many kids do get services while they are in high school and then when they leave there may not be a safety net or services available to them," said Dewey Cornell, a forensic clinical psychologist and education professor at the University of Virginia. He said the age of greatest risk "for serious acts of violence is in the late teens and early 20s, after the high school years."
Businesses across the country are recognizing the need for threat assessment programs to look out for signs of danger from employees, said Matt Doherty, a former U.S. Secret Service agent who provides workplace training.
Doherty said he recently helped a health services company terminate an employee who had shown severe anger-management issues. Officials followed him after he was fired, and he went directly to a store and bought a gun. Doherty said he went to the see the man's wife, who said he had recently stopped taking medication.
Doherty helped the wife obtain a court order for mental health treatment for her husband and to have his gun temporarily removed. The man was put back on his medication.
"It likely would have led to tragic consequences otherwise," Doherty said.
But if a person doesn't work for a company that has a threat-assessment program, it can often be left to friends and family to spot problems - and the FBI study found that those people are often the least likely to report them.
The result is that the difference between a mass shooting and a peaceful resolution can often come down to chance and luck.
Authorities in South Carolina arrested a 16-year-old boy last month for making threats after videos surfaced in which he called himself a "hater of all black men," fired a semiautomatic rifle at objects meant to portray "stinky" black people and said he planned "to shoot up" his Catholic high school.
School officials learned of the videos, which had been made in May, from parents who spotted them. Officials expelled the student on July 15 for one video in which he made racist comments. The video threatening to "shoot up" the school was found by another parent on July 17, and school officials called police, who arrested the teen.
Principal Robert Loia sent a letter to school families on Aug. 2 alerting them to the situation. On Aug. 4, he sent another letter saying he had not alerted families sooner because "the teen had been arrested and the threat had been neutralized." On Aug. 5, he sent an apology for not alerting them immediately.
"This is an example of how schools and law enforcement can work together to quickly address threats and perceived threats to schools and students," said Richland County Sheriff Leon Lott.
The same week that the South Carolina teen was arrested, William Patrick Williams, 19, of Lubbock, Texas, called his grandmother from a hotel room and told her he was homicidal and suicidal and was planning to "shoot up" the hotel with his AK-47 rifle then commit "suicide by cop." She talked him out of it and took him to a hospital for psychiatric evaluation; he was later arrested on federal firearm charges.
Williams, who spent a year in the military, began acting out in high school, a family member said, noting that "there was a questionable thing he said and some papers and drawings, but not a direct threat."
The family member said that in hindsight, the schools could have done more.
"They would push kids away and place them in alternative schools," the family member said. "It's a disservice to the child. Kids know they did wrong, but how does that help them? The issues stem from something else, and they need help."
In July, when Williams purchased the semiautomatic weapon, he had been on medication and was undergoing treatment for depression. "He was getting help and taking steps to get better - working, living on his own. He was functioning," the family member said.
Many, but not all, of the nation's most notorious mass shooters were young men recently out of school, who had exhibited concerning behavior, had few friends and were either unemployed or sporadically employed.
Patrick Crusius, 21, the suspect in the El Paso shootings, graduated high school in Plano, Texas, in 2017 and was attending community college while living with his grandparents, where officials believe he wrote a manifesto about "the Hispanic invasion of Texas."
Nikolas Cruz, charged with killing 17 people in Parkland, Fla., in 2018, had been expelled from Marjory Stoneman Douglas High School the year before, had a long history of problems, and interacted with school counselors, law enforcement and mental health officials. At the time of the shooting, he was 19, living with friends and working at a local store.
Adam Lanza, 20, who massacred more than two dozen people, mostly children, in Newtown, Connecticut, in 2012, had a long history of mental health problems and left high school early. In his final weeks, a state investigation concluded, he spent most of his time secluded in his room communicating online with "a small community of individuals that shared his dark and obsessive interest in mass murder."
"Once they graduate or leave school, it doesn't mean the threat has gone away," said Russell Palarea, president of the Association of Threat Assessment Professionals, a key driver of a bill that Congress is considering, known as the Threat Assessment, Prevention, and Safety Act (TAPS), which has bipartisan support. It would create a team of experts to set national guidelines on community-based threat assessment and then provide federal grants for implementation.
Palarea said the work that schools have done to improve vigilance needs to be extended into communities, noting that few in the United States have formal programs to track potentially dangerous people. He cited the Jefferson County, Colorado, Public Schools Threat Assessment Program, started after the 1999 Columbine High School shooting, as an effective model. That program provides anyone in the community an anonymous method for reporting distressing behavior.
"It's all about building a safety net," he said.
But efforts to help identify threats can also run into concerns about privacy and civil rights, with the potential for unfair and damaging effects.
Florida has faced opposition in its effort to develop a database about students that is intended to prevent school shootings. Gov. Ron DeSantis, a Republican, has pushed for the measure, but 33 civil rights, disabilities, privacy and education advocacy groups have urged him to ditch what they call "a massive surveillance effort."
"We are deeply concerned that the program will be used to label students as threats based on data that has no documented link to violent behavior, such as data on disabilities or those seeking mental health care," the letter said.
Amanda Nickerson, a professor of school psychology at the University at Buffalo, State University of New York, said teachers must flag students they suspect of being potential threats. Sometimes those troubles are noted in students' academic records, and other times the troubles are serious enough that teachers contact law enforcement.
Nickerson said students' academic records do not follow them beyond graduation, and changing that could harm them as they look for jobs and housing.
"They absolutely have an obligation to monitor students and issues of concern and investigate them and help to resolve them," Nickerson said. "What's difficult is what happens once they leave the school system."