This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

The white gunman accused of committing a racist massacre at a Buffalo supermarket made threating comments that brought police to his high school last spring, but he was never charged with a crime and had no further contact with law enforcement after his release from a hospital, officials said.

The revelation raised questions about whether his encounter with police and the mental health system was yet another missed opportunity to put a potential mass shooter under closer law enforcement scrutiny, get him help, or make sure he didn’t have access to deadly firearms.

Authorities said Sunday that they were investigating the attack on predominantly Black shoppers and workers at the Tops Friendly Market as a potential federal hate crime or act of domestic terrorism.

Payton Gendron, 18, traveled about 200 miles (320 kilometers) from his home in Conklin, New York, to Buffalo to commit the attack, police said.

Federal authorities were still working to confirm the authenticity of a racist 180-page document, purportedly written by Gendron, that said the assault was intended to terrorize all non-white, non-Christian people and get them to leave the country.

Law enforcement officials revealed Sunday that New York State Police troopers had been called to Gendron’s high school last June, for a report that Gendron, then 17, had made threatening statements.

Gendron threatened to carry out a shooting at Susquehanna Valley High School, in Conklin, New York, around the time of graduation, a law enforcement official who spoke on condition of anonymity said. The official was not authorized to speak publicly on the investigation.

Buffalo Police Commissioner Joseph Gramaglia said Gendron had no further contact with law enforcement after a mental health evaluation that put him in a hospital for a day and a half.

“Nobody called in,” he said. “Nobody called any complaints,” Gramaglia said. The threat was “general” in nature, he said, and not related to race.

New York is one of several states that have enacted “red flag” laws in recent years that were intended to try and prevent mass shootings committed by people who show warning signs that they might be a threat to themselves or others.

Those laws allow law enforcement officers, a person’s family, or in some cases, medical professionals or school officials to petition courts to temporarily seize a troubled person’s firearms, or prevent them from buying guns.

Federal law bars people from owning a gun if a judge has determined they have a “mental defect” or they have been forced into a mental institution — but an evaluation alone would not trigger the prohibition.

It is unclear whether officials could have invoked “red flag” legislation after the incident at Susquehanna Valley High School. Police and prosecutors wouldn’t provide details on the incident, or say when Gendron had purchased the weapons used in the assault.

The long list of mass shootings in the U.S. involving missed opportunities to intervene includes the 2018 massacre of 17 students at a high school in Parkland, Florida, where law enforcement officials had received numerous complaints about the gunman’s threatening statements, and the killings of more than two dozen people at a Texas church in 2017 by a former U.S. Air Force serviceman who was able to buy a gun despite a violent history.

The victims of Saturday’s attack in Buffalo included an 86-year-old woman who had just visited her husband in a nursing home, a man buying a cake for his grandson, a church deacon helping people get home with their groceries and a supermarket security guard.

The shooter livestreamed the attack on Twitch, prompting scrutiny of how fast social platforms react to violent videos.

President Joe Biden planned to visit Buffalo Tuesday.

Gendron surrendered to police who confronted him in the supermarket’s vestibule. He was arraigned later Saturday on a murder charge. Relatives didn’t respond to messages.

A lengthy statement circulating online, attributed to Gendron, outlined a racist ideology rooted in a belief that the United States should belong only to white people.

Portions of the Twitch video circulating online showed the gunman killing multiple shoppers in less than a minute. At one point, he trains his weapon on a white person cowering behind a checkout counter, but says “Sorry!” and doesn’t shoot.

Screenshots purporting to be from the broadcast appear to show a racial slur targeting Black people scrawled on his rifle.

Authorities said he shot, in total, 11 Black people and two white people Saturday.

“This individual came here with the express purpose of taking as many Black lives as he possibly could,” Buffalo Mayor Byron Brown said at a news conference Sunday.