A gunman opened fire with a rifle Saturday at a supermarket in Buffalo, N.Y., in what authorities called a “hate crime and racially motived violent extremism,” killing 10 people and wounding three others before being taken into custody, law enforcement officials said.

Police officials said the gunman, who wore body armor in addition to military-style clothing, pulled up Saturday afternoon and opened fire with a rifle at a Tops Friendly Market, livestreaming the shooting via a camera affixed to his helmet.

“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 livestreaming what he was doing,” city Police Commissioner Joseph Gramaglia said at a news conference.

Gramaglia said the gunman shot four people outside the store, and three of them died. Inside the store, a security guard who was a retired Buffalo police officer fired multiple shots at the gunman and struck him, but the bullet hit the gunman’s bulletproof vest and had no effect, Gramaglia said. He said the gunman then killed the security guard.

Video showed the suspect walking into the supermarket and shooting several other victims inside, according to authorities.

Officials said 11 of the victims are Black and two are white. The shooting happened in a predominantly Black neighborhood a few miles north of downtown Buffalo.