A 21-year-old man accused of killing 10 people at a Colorado supermarket was someone prone to rages who had once been suspended from high school for a sudden attack on a classmate, former associates said.

Ahmad Al Aliwi Alissa, who is from the Denver suburb of Arvada, has been charged with murder after the attack at a King Soopers grocery in Boulder. He is due to appear in court on Thursday.

Alissa had bought an assault weapon on March 16, six days before the attack, according to an arrest affidavit.

Boulder County district attorney Michael Dougherty said investigators have not yet established a motive. It is not yet known where the suspect purchased the weapon.

Among the dead was Boulder police officer Eric Talley, 51, who was the first to arrive after responding to a call about shots fired and someone carrying a gun, said police chief Maris Herold.

A law enforcement official said the suspect's family told investigators they believed Alissa was suffering some type of mental illness, including delusions.

Relatives described times when Alissa told them people were following or chasing him, which they said may have contributed to the violence, the official said.

After the shooting, detectives went to Alissa's home and found his sister-in-law, who told them that he had been playing around with a weapon she thought looked like a "machine gun" about two days earlier, according to an arrest affidavit.

No-one answered the door on Tuesday at the Arvada home believed to be owned by the suspect's father. The two-storey house with a three-car garage sits in a relatively new middle- and upper-class neighbourhood.

When he was a high school senior in 2018, Alissa was found guilty of assaulting a fellow student in class after knocking him to the floor, then climbing on top of him and punching him in the head several times, according to a police affidavit.

Alissa complained that the student had made fun of him and called him "racial names" weeks earlier, according to the affidavit.

He was suspended from school and sentenced to probation and community service.

One of his former high school wrestling teammates, Angel Hernandez, said Alissa got enraged after losing a match in practice once, letting out a stream of invectives and yelling he would kill everyone.

Mr Hernandez said the coach had kicked Alissa off the team for the outburst.

"He was one of those guys with a short fuse," Mr Hernandez said. "Once he gets mad, it's like something takes over and it's not him. There is no stopping him at that point."

Mr Hernandez said Alissa also would act strangely sometimes, turning around suddenly or glancing over his shoulder. "He would say: 'Did you see that? Did you see that?'" Mr Hernandez recalled. "We wouldn't see anything. We always thought he was messing with us."

Arvada police investigated but dropped a separate criminal mischief complaint involving the suspect in 2018, said Detective David Snelling.

"Our community is obviously concerned and upset that the suspect lived here," Detective Snelling said.

On Tuesday night, about 100 people mourned at a makeshift memorial near the grocery that was adorned with wreaths, candles and banners reading "#Boulderstrong", and 10 crosses with blue hearts and the victims' names. Therapy dogs were on hand to provide comfort.

Homer Talley, 74, the father of victim Officer Eric Talley, described his son as a devoted father who "knew the Lord". He had seven children, aged seven to 20.

The other dead were identified as Denny Stong, 20; Neven Stanisic, 23; Rikki Olds, 25; Tralona Bartkowiak, 49; Suzanne Fountain, 59; Teri Leiker, 51; Kevin Mahoney, 61; Lynn Murray, 62; and Jodi Waters, 65.

Monday's attack was the seventh mass killing this year in the US, following the March 16 shooting that left eight people dead at three Atlanta-area massage businesses, according to a database compiled by the AP, USA Today and Northeastern University.

It follows a lull in mass killings during the coronavirus pandemic in 2020, which had the smallest number of such attacks in eight years, according to the database, which tracks mass killings defined as four or more dead, not including the shooter.

In Washington, President Joe Biden called on US congress to tighten the nation's gun laws.

Senate majority leader Chuck Schumer vowed to bring forward two house-passed bills to require expanded background checks for gun buyers.

Mr Biden supports the measures, but they face a tougher route to passage in a closely divided senate with a slim Democratic majority.