The 18 year-old suspect in a mass shooting on Saturday in Buffalo, New York state, in which 10 people were killed, had been investigated by police last year for allegedly making a threatening statement at his high school.
State police in New York brought the then 17-year-old for a mental health evaluation at a hospital and he was discharged a day and a half later.
Buffalo police commissioner Joseph Gramaglia said on Sunday there had been reports the suspect in the shootings had made a "generalised threat". He said the threat made in 2021 had not been racially motivated.
Police in New York state are treating as a racially motivated hate crime the murder of the 10 people by a heavily armed gunman at a supermarket in Buffalo on Saturday afternoon.
Police said the gunman shot 11 black victims and two white before surrendering.
The 18-year-old suspect, identified in court as Payton Gendron of Conklin, New York, pleaded not guilty on Saturday evening to first-degree murder, a charge that could lead to life imprisonment without parole.
Erie Country district attorney John Flynn said evidence in the case might support a charge of "domestic extremism motivated by race" against Mr Gendron.
Federal authorities in the United States have said they are pursuing the case as a racially motivated hate crime, meaning they could file federal civil rights charges as well.
"It was a straight up racially motivated hate crime," John Garcia, the Erie County sheriff, said.
Investigators are reviewing a document, previously posted online in a Google document, that they suspect was written by Mr Gendron.
The 180-page document sets out white-supremacist motivations and conspiracy theories. The author describes being inspired by seeing an online video of a 2019 shooting of the Al Noor Mosque in New Zealand, and by the 2015 shooting at a church in Charleston, South Carolina.
Federal and state law enforcement officials on Sunday carried out searches at the suspect's home in Conklin, a small town outside of Binghamton.
US president Joe Biden said more needed to be learned about the attack in Buffalo. However, he linked it to domestic terrorism.
“A racially motivated hate crime is abhorrent to the very fabric of this nation. Any act of domestic terrorism, including an act perpetrated in the name of a repugnant white nationalist ideology, is antithetical to everything we stand for in America. Hate must have no safe harbour. We must do everything in our power to end hate-fuelled domestic terrorism.”
New York governor Kathy Hochul said: "It is my sincere hope that this individual, this white supremacist who just perpetrated a hate crime on an innocent community, will spend the rest of his days behind bars. And heaven help him in the next world as well."
Officials said the gunman, who used an assault weapon in the Buffalo attack, had been wearing military-style tactical gear including a helmet.
Mr Gramaglia said the gunman shot four people outside the store, three fatally. Inside the store, a security guard who was a retired local police officer fired multiple shots at the attacker. However, the commissioner said the rounds had been blocked by the body armour worn by the gunman. He then killed the guard before moving through the store shooting other victims.
Upon being confronted by police, the suspect had put the gun to his own neck before officers talked him into dropping the weapon.
Ms Hochul told ABC News on Sunday that an investigation would focus on what could have been done to stop Gendron, since he had advertised his views online and had been on the authorities’ radar.
“I want to know what people knew and when they knew it,” she said.
Authorities said Gendron drove to Buffalo from his home several hours away to launch the attack, which he broadcast in real time on social media platform Twitch, a live video service owned by Amazon. com.
He opened fire at the Tops grocery store using a gun that he had legally purchased but had illegally modified a high-capacity magazine, Ms Hochul said.
She told reporters she was dismayed that the suspect managed to live-stream his attack on social media, which she blamed for hosting a “feeding frenzy” of violent extremist ideology.
“These outlets must be more vigilant in monitoring social media content,” she said.
Social media and streaming platforms such as Twitch, which said it removed the stream after less than two minutes, have grappled with controlling violent and extremist content for years.
Gendron entered a plea of not guilty and is scheduled to return to court on May 19th. He was on suicide watch and isolated from other incarcerated individuals on Sunday, Erie County Sheriff John Garcia said. – Additional reporting Reuters