An 18-year-old white, male suspect is in custody, police said. The shooter live-streamed the attack on social media, authorities said.
The guard shot and struck the suspect, but without effect due to the body armor, police said.
The gunman then proceeded to shoot nine more people inside the store, police said. He threatened to shoot himself before dropping his gun and surrendering to police, authorities said.
Among the 13 victims shot, 11 were African American and two were white, authorities said.
Four of the shooting victims were store employees, while the rest were customers, authorities said. The Buffalo police officer working security was among those killed, according to a law enforcement official.
Three victims suffered non-life-threatening gunshot wounds, authorities said.
The scene is no longer active and there are no other suspects outstanding, a law enforcement official said.
The suspect, who has not been identified, will be charged initially with state murder charges and arraigned later Saturday, Erie County District Attorney John Flynn said at a press briefing Saturday evening. The suspect traveled from a New York county several hours away to the Buffalo store, authorities said.
“This is the worst nightmare any community can face,” Buffalo Mayor Byron Brown said at the briefing.
The FBI is investigating the attack as a hate crime and as racially motivated violent extremism.
Early indications are the shooter may have possessed extremist beliefs cultivated online, law enforcement sources told ABC News.
Investigators are looking at multiple online postings that may be associated with the shooter that include praise for South Carolina church shooter Dylan Roof and the New Zealand mosque shooter Brenton Tarrant, according to the sources.
“This was pure evil,” Erie County Sheriff John Garcia told reporters. “It was a straight-up racially motivated hate crime from somebody outside of our community…coming into our community and trying to inflict evil upon us.”
Flynn said there are pieces of evidence that “indicate some racial animosity,” but would not elaborate more at this point in the investigation.
A home associated with the suspect in Conklin, a town near Binghamton, was being searched by the FBI and New York State Police Saturday evening, according to law enforcement officials and eyewitnesses.
Authorities did not specify which social media platform the suspect used to allegedly livestreamed the shooting. But following the attack, the video game live streaming platform Twitch said it had indefinitely suspended a user over the shooting in Buffalo.
“Twitch has a zero-tolerance policy against violence of any kind and works swiftly to respond to all incidents,” a Twitch spokesperson said in a statement. “The user has been indefinitely suspended from our service, and we are taking all appropriate action, including monitoring for any accounts rebroadcasting this content.”
New York Gov. Kathy Hochul said on Twitter she is “closely monitoring” the shooting, and that her office has offered assistance to local officials.
Erie County Executive Mark Poloncarz also tweeted Saturday afternoon that he had been “advised of an active multiple shooting event” at the supermarket.
“A horrible day in the history our community,” Poloncarz said in a statement. “Like too many communities in our nation, we’ve been impacted by the horror [of] a mass shooting. My thoughts are about the deceased and with their families at this terrible time.”
President Joe Biden has been briefed on the shooting, his press secretary said.
“He will continue to receive updates throughout the evening and tomorrow as further information develops,” White House press secretary Karine Jean-Pierre said in a statement. “The President and the First Lady are praying for those who have been lost and for their loved ones.”
Attorney General Merrick Garland also has been briefed on the shooting, a source said.
“While we should all be saddened we shouldn’t be surprised,” said John Cohen, a former Homeland Security acting intelligence and analysis official and an ABC News contributor. “DHS and FBI have repeatedly warned that the primary terrorism threat facing the US comes from lone offenders who commit mass casualty attacks inspired by extremist beliefs they cultivate by consuming online content.”
Tops Friendly Markets said in a statement it was “shocked and saddened” by the shooting and offered condolences to the victims and their families.
“We appreciate the quick response of local law enforcement and are providing all available resources to assist authorities in the ongoing investigation,” the Amherst, New York-based supermarket chain said.
NAACP President Derrick Johnson called the organization was “shattered” and “extremely angered” by the incident.
“This is absolutely devastating. Our hearts are with the community and all who have been impacted by this terrible tragedy,” Johnson said. “Hate and racism have no place in America.”
ABC News’ Matt Foster and Luke Barr contributed to this report.
This is a developing story. Please check back for updates.