Payton Gendron, an 18-year-old white man, has shot dead 10 people in a black neighbourhood of New York state.
Three others were wounded in an attack described as racially motivated.
Eleven of the victims were Black, and two were white, according to officials.
Gendron drove more than 200 miles to mount his attack, which he also live-streamed, CNN reports.
Joseph Gramaglia, Buffalo police commissioner, said the suspect killed nine customers and a retired police officer working as an armed security guard.
“He exited his vehicle. He was very heavily armed. He had tactical gear. He had a tactical helmet on. He had a camera that he was live-streaming what he was doing,” Gramaglia said.
Stephen Belongia, special agent in charge of the FBI’s Buffalo field office, told reporters that the shooting is being investigated as “both a hate crime and a case of racially motivated violent extremism”.
US President Joe Biden condemned what he called an “abhorrent” act.
Gendron has now been arraigned on a charge of first-degree murder, which carries a sentence of life without parole. He is being held without bail.