Authorities said the attack would be investigated as a “hate crime” and an act of “racistly motivated violent extremism”, Reuters reported.
Authorities said the perpetrator, who was armed with an assault rifle and appeared to act alone, came to Buffalo from a New York county “hours away” to target the store in an online attack.
Court papers named the suspect as Payton Gendron of Conklin, a town of about 5,000 people in Southern New York’s Southern Tire near the Pennsylvania border.
Authorities said the young man, who local media reported was a student at Broome Community College of the State University of New York near Binghamton, had approached suicide before his arrest.
Officials said 11 of the 13 people shot were black, and the other two were white.
Police said the gunman was heavily armed and was wearing a flak jacket.
Buffalo Police Commissioner Joseph Grammaglia told a news briefing that when the gunman confronted the cops at the store, he put a gun to his neck, but they spoke to him and persuaded him to lay down the gun and surrender.
Grammaglia said the gunman initially exchanged fire with a former policeman who works as a security guard at the store, but the gunman was protected by his flak jacket.
This guard was one of the ten who were shot dead in the accident.
Authorities said three others were wounded, but they were expected to survive.
Stephen Bilongia of the FBI said the attack would be investigated as a hate crime and an act of “racially motivated violent extremism” under federal law.