Law enforcement officials in the northeastern U.S. city of Buffalo, New York, worked Sunday to piece together the background of the teenage gunman who opened fire in a grocery store, killing 10 people and wounding three in what authorities described as “racially motivated violent extremism.”

Buffalo Mayor Byron Brown told CBS’s “Face the Nation” show that police “are going through every element, every detail in this shooter’s background to piece together why this happened, how this happened, and the reason that this person came to the city of Buffalo to perpetrate this horrific crime.”

The shooter was identified as Payton Gendron, of Conklin, a New York state community about 320 kilometers southeast of Buffalo. He is white and 11 of the 13 shooting victims were Black.

Authorities say he carried out the mayhem mid-Saturday afternoon while wearing military gear and livestreaming it with a helmet camera. He eventually dropped his weapon and surrendered to police inside the Tops Friendly Market, located in a predominantly Black neighborhood in the city of 278,000 people.

“We are certainly saddened that someone drove from hundreds of miles away, someone not from this community that did not know this community that came here to take as many Black lives as possible, who did this in a willful, premeditated fashion, planning this,” said Brown, who is Buffalo’s first Black mayor.

“But we are a strong community and we will keep moving forward,” he said. “This is a community that is experiencing development. People have been hoping and waiting for investment and growth and opportunity. We won’t let hateful ideology stop the progress that we are seeing and experiencing in the city of Buffalo.”

As is often the case after mass shootings in the United States, Brown called on Congress to enact tougher gun control laws, saying, “We have to put more pressure on lawmakers in Washington, those that have been obstructionists, to sensible gun control, to reforming the way guns are allowed to proliferate and fall into the wrong hands in this country.”

Such pleas after past mass shootings have mostly gone unheeded, with scant changes in gun control laws. Gun ownership in America is codified in the U.S. Constitution.

Wearing a hospital gown, Gendron was arraigned in court Saturday night on first-degree murder charges and ordered detained without bail. Another court hearing is scheduled in the coming days.

At an earlier news briefing, Erie County Sheriff John Garcia pointedly called the shooting a hate crime.

“This was pure evil. It was straight up racially motivated hate crime from somebody outside of our community, outside of the City of Good Neighbors … coming into our community and trying to inflict that evil upon us,” Garcia said.

Investigators said they are reviewing a lengthy statement that they suspect was posted online by the gunman describing his white-supremacist motivations and ideology. The 180-page document details the author’s radicalization on internet forums, as well as a plan to target a predominantly Black neighborhood.

The author described himself as a white supremacist, fascist and antisemite. The statement repeats a far-right conspiracy theory that baselessly argues that the white population in Western countries is being reduced — or “replaced” — by non-white immigrants.

Mayor Brown said the combination of guns and such ideology is combustible.

“It’s not just Buffalo, New York. It’s communities in every corner of this country that are unsafe with guns and with the hateful ideology that has been allowed to proliferate on social media and the internet,” he told CBS. “That has to be reined in. That has to be stopped. It’s not free speech. It’s not American speech. It’s hate speech. And it must be ended.”