An 18-year-old white man has shot dead 10 people in a black neighbourhood of New York state in what authorities are calling a racially motivated attack.
The man, named as Payton Gendron in court papers, was arrested after a stand-off at the scene - a supermarket in the city of Buffalo.
He began firing in the store's car park before entering and continuing his rampage, streaming the attack online.
US President Joe Biden condemned what he described as an "abhorrent" act.
"We are investigating this incident as both a hate crime and a case of racially-motivated violent extremism," said Stephen Belongia, from the FBI's Buffalo office, adding there was evidence of "racial animosity."
CBS news reported that the attacker shouted racial slurs during the shooting and suggested that he had a racial slur written on his weapon. He also apparently posted a manifesto online which included racist language and ideas.
The suspect is believed to have driven for some 200 miles to reach the predominantly black area of the city.
Three people were shot dead in the car park and the other seven were killed inside the supermarket, police said. Most of the victims were black.
"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 live-streaming what he was doing," Buffalo Police Commissioner Joseph Gramaglia told reporters.
He said the suspect surrendered his weapon after a tense stand-off and was taken into custody. He later appeared in court charged with first degree murder.
Three more people, all supermarket staff, were wounded in the shooting but did not sustain life-threatening injuries.
A retired police officer, named in local media as Aaron Salter, was working as a security guard in the store and was shot dead in the attack. Police said he had tried to shoot the suspect, who then shot him dead.
Two of the other people killed have been named in the local paper as Ruth Whitfield and Katherine Massey. A church deacon who worked as a driver was also killed, Buffalo News reports.
"This is the worst nightmare that any community can face and we are hurting, we are seething right now," Buffalo Mayor Byron Brown told reporters.
"We cannot let this hateful person divide our community or our country," he added.
Grady Lewis, who witnessed the attack from across the street, told local media that he saw the man open fire. "I saw the guy go in, army-style, bent over, just shooting at people," he said.
Shonnell Harris, who was working in the shop during the attack, told Buffalo News that she heard more than 70 shots as she ran to escape the building through a backdoor.
"The store was full. It was the weekend," she said. "It feels like a nightmare."
Describing the aftermath of the attack, one police officer told Buffalo News: "It's like walking onto a horror movie, but everything is real. It is Armageddon-like".
Later on Saturday, New York Governor Kathy Hochul said the suspect was a "white supremacist who has engaged in an act of terrorism".
This was "a military style execution targeting people who simply wanted to buy groceries in a neighbourhood store," she said while visiting Buffalo.
In a statement, US President Joe Biden said he and the First Lady were praying for the victims and their families.
"A racially-motivated hate crime is abhorrent to the very fabric of this nation," he said. "We must do everything in our power to end hate-fuelled domestic terrorism."
Hate crimes in the US hit a 12-year high in 2020, with over 10,000 people reporting offences related to their race, gender, sexuality, religion or disability. Crimes against Asian and black Americans in particular surged that year, FBI figures suggest.
As police are not mandated to submit hate crime data to the FBI, those numbers are thought likely to be an undercount.
Saturday's attack in Buffalo is thought to be the worst mass shooting so far in the US in 2022, and will also further inflame the bitter political battle about gun control in the US.
Some 40,000 deaths a year involve firearms in America, a figure that includes suicides.