BUFFALO, N.Y. -- On Saturday afternoon, a white gunman in military gear attacked shoppers and workers at a supermarket in Buffalo, New York, killing 10 people and wounding three others. Most of the victims were Black. Officials said they are investigating the shooting as a racially motivated hate crime.

A look at what we know so far:

WHAT HAPPENED?

A white 18-year-old wearing military gear and livestreaming with a helmet camera opened fire Saturday afternoon at Tops Friendly Market. That's a supermarket in a predominantly Black neighbourhood of Buffalo, New York.

The gunman livestreamed the shooting to a small audience on Twitch for several minutes before the platform cut off his feed.

According to police, the gunman began shooting in the parking lot then moved inside the store. Security guard Aaron Salter fired multiple shots but none penetrated the gunman's armour. The gunman killed Salter and then stalked through the aisles, shooting shoppers.

At one point, he trained his weapon on a white person cowering behind a checkout counter, but says “Sorry!” and doesn't shoot, as seen in portions of the livestream video circulating online.

When police confronted the gunman in the store's vestibule, he put his rifle to his own neck, but surrendered and dropped the gun with coaxing from the officers.

WHO IS THE SUSPECTED GUNMAN?

Police have identified the gunman as Payton Gendron, of Conklin, New York. Conklin is a small town about 200 miles (320 kilometres) southeast of Buffalo, not far from the Pennsylvania state line.

Officials said the rifle Gendron used in the attack was purchased legally but the magazines he used for ammunition were not allowed to be sold in New York.

After the shooting, Gedron appeared before a judge in a paper medical gown and was arraigned on a murder charge.

A document circulated widely online seemingly outlines Gedron's white supremacist, racist, anti-immigrant and antisemitic beliefs. Among them was a desire to drive all people not of European descent from the U.S. The document seemed to draw inspiration from the gunman who killed 51 people at two mosques in Christchurch, New Zealand, in 2019.

Authorities said Gendron had researched local demographics and conducted reconnaissance as part of his efforts to target Black people.

The document also says Gendron considered killing more people after the supermarket, including people on the streets and perhaps another store.

Authorities say that Gendron had made a “general” threat at Susquehanna Valley High School last June and underwent a mental health evaluation at a hospital. He was 17 at the time.

WHO ARE THE VICTIMS?

Police said the 13 victims, including the wounded, ranged in age from 20 to 86.

The 10 dead include Aaron Salter, a retired Buffalo police officer working as a security guard at the store. Salter fired multiple shots at the assailant, striking his body armor at least once, although the bullet did not pierce. Officials called him a a hero who saved lives by running toward danger. A local resident said he cared about the community and looked after the store.

Ruth Whitfield, 86, was picking up groceries after visiting her husband at a nursing home, as she did every day. She was the mother of retired Buffalo Fire Commissioner Garnell Whitfield, who told The Buffalo News she was “a mother to the motherless” and “a blessing to all of us.” Whitfield attributed his mother's strength and commitment to family to her religious faith.

Katherine Massey, 72, was “a beautiful soul” who was killed while shopping, sister Barbara Massey said.

Heyward Patterson, 67, was a deacon at a nearby church. He'd gone by the church's soup kitchen before heading to the supermarket, where he offered an informal taxi service and would drive people home with their bags.

The other people killed in the shooting were Roberta A. Drury, 32, Margus D. Morrison, 52, Andre Mackneil, 53, Geraldine Talley, 62, Celestine Chaney, 65, and Pearl Young, 77. The injured included Zaire Goodman, 20, Jennifer Warrington, 50, and Christopher Braden, 55.

WHAT DO WE KNOW ABOUT THE RIFLE USED IN THE SHOOTING?

Gendron bought the AR-15-style rifle used in the shooting at a store in Endicott, New York, within the past few months, according to the store's owner.

Robert Donald, owner of Vintage Firearms, told ABC News and The New York Times that he has records of the purchase, but does not remember selling the rifle to Gendron. He said Gendron passed an instant background check on the day he bought the weapon. He said federal agents informed him that the rifle he sold to Gendron was used in the shooting.

“I mean, who would do this,” Donald told ABC News. “I've been open since 1993 and this is the first time there has been any kind of a problem.”