When a shooter attacked a supermarket in Buffalo, New York, over the weekend, its security guard tried to stop him. At least one of his shots hit the gunman, but it didn’t stop the deadly rampage because the gunman was wearing body armor.

Ten Black people died in the racist massacre, including security guard Aaron Salter, a retired Buffalo police officer hailed as a hero. It's the latest mass shooting in which the gunman apparently came prepared for anyone trying to stop him with a gun.

At least 21 mass shooters over the last four decades have worn some kind of body armor — and the majority of those were within the last 10 years, according to a database maintained by The Violence Project, a nonpartisan research group that tracks gun violence.

Among them: A massacre that killed 12 people and injured dozens more at a crowded movie theater in Aurora, Colorado, in 2012, and another in nearby Boulder that left 10 people dead at a supermarket last year. The shooter in Texas's deadliest mass slaying was also wearing protective gear when he killed more than two dozen people at a church in 2017, as was a radicalized Islamic couple who carried out a terror attack in San Bernardino, California, in 2015.

“They’re demonstrating this intent that, ‘I want to absolutely kill or hurt as many people as I possibly can before I just can’t fight anymore,’” said Chris Burbank, the former police chief in Salt Lake City who’s now with the Center for Policing Equity.

The Violence Project database doesn't show a clear correlation with body armor and the number of victims. But such gear can enable attackers to shoot longer and is a symbolic way to adhere to societal expectations of what a mass shooting looks like, said James Densley, a criminal justice professor at Metro State University in Minnesota who co-founded The Violence Project.

“A mass shooting is intended to be a final act — you don’t get away with a mass shooting,” Densley said. “So it’s meant to be a big spectacle, and it’s meant to have people pay attention and to notice it. One of the ways you do that is you dress up pretending you’re in the military.”

Police officers are seeing body armor in other types of investigations, like narcotics cases, said former Miami Police Chief Jorge Colina. Body armor is relatively easy to get, especially the soft body armor similar to the bulletproof vests regularly worn by police officers that are effective against handguns.

Getting body armor isn’t difficult under U.S. laws. It’s illegal under federal law for a convicted felon to buy body armor, but other than that there are few restrictions on purchasing it. Only one state blocks it from being ordered online and shipped to homes: Connecticut, which requires a face-to-face purchase.

Colina would like to see more states consider stricter rules.

“I don’t think it’s something that is really thought about too much, but we’ve seen it many times and we’ve seen it here in south Florida," Colina said. "Somebody commits a crime wearing body armor, and it’s terrifying. The idea that you may not be able to stop them if you had to use deadly force is terrifying.”

Still, body armor itself isn't inherently dangerous and is in fact aimed at protection — something on the minds of many people amid a spike in gun violence in the U.S., Burbank said. And it’s unclear what effective body armor regulation would even look like, given the difficulty of regulating the weapons that are used in the shootings.

“Most of those same laws apply to guns," Burbank said. "Does that prohibit anyone in this nation from having access to a firearm?”

Body armor hasn't been worn in the majority of mass shootings, said James Alan Fox, a criminologist at Northeastern University who has been tracking mass killings back to 2006 along with The Associated Press and USA Today.

But it does indicate a level of planning. Body armor was mentioned more than a dozen times in the online writings attributed to the white suspect in the Buffalo shooting, Payton Gendron, who was arrested at the supermarket and has pleaded not guilty to murder.

The Violence Project database also doesn't include slayings that don't meet the definition of a mass shooting because fewer than four people were killed.

In one such shooting at Philadelphia’s Thomas Jefferson University Hospital last October, a nursing assistant wearing blue scrubs and a ballistics vest killed a co-worker and then wounded two police officers before being killed himself. In another, this month in Round Rock, Texas, a 31-year-old Marine veteran wounded a neighbor before engaging in a shootout with law enforcement, after which he was found dead, wearing body armor.

In contrast to U.S. laws, four Canadian provinces have enacted severe restrictions on the possession of body armor — Alberta, British Columbia, Manitoba and Nova Scotia. Residents must obtain permits to possess body armor, including ballistic vests, and must undergo background checks before getting those permits, which must be renewed on an annual or biannual basis. Violators face hefty fines and jail time.

Alberta adopted its law in 2012 because of spiraling gang violence in which gang members wore vests while committing crimes such as drive-by shootings and even sported them in public, said Ian Roddick, a spokesman with the province’s Ministry of Justice and Solicitor General.

Applicants must have no criminal record. Permits generally are granted to those whose jobs, such as security guards, require protection.

Some Australian territories also restrict body armor possession.

___

Associated Press writer Susan Haigh in Hartford, Connecticut, contributed to this report.