BOULDER, Colo. (NewsNation Now) — The suspect accused of opening fire on a crowded Colorado supermarket was a 21-year-old man who purchased an assault weapon less than a week earlier, authorities said Tuesday, a day after the attack that killed 10 people, including a police officer.

Ahmad Al Aliwi Alissa bought the weapon on March 16, just six days before the attack at a King Soopers store in Boulder, according to an arrest affidavit. It was not immediately known where the gun was purchased.

Ahmad Al Aliwi Alissa booking photo (Boulder Police Department)

Alissa was charged with 10 counts of first-degree murder in the mass shooting at a King Soopers grocery store. He also faces one charge of criminal attempt for murder in the first degree.

Court documents show that he purchased an assault rifle less than a week before the Monday attack.

Supermarket employees told investigators that Alissa shot an elderly man multiple times outside the Boulder grocery store before going inside, according to the affidavit. Another person was found shot in a vehicle next to a car registered to the suspect’s brother.

The suspect lived in Arvada, a Denver suburb, and investigators said they were confident he had acted alone. Boulder County District Attorney Michael Dougherty said the suspect was undergoing treatment at a hospital, but was booked into jail on murder charges later in the day.

Multiple 911 calls paint a picture of a chaotic, terrifying scene, according to the affidavit.

One caller said the suspect opened fire out the window of his vehicle. Others called to say they were hiding inside the store as the gunman fired on customers. Witnesses described the shooter as having a black AR-15-style gun and wearing blue jeans and maybe body armor.

By the time he was in custody, Alissa had been struck by a bullet that passed through his leg, the affidavit said. He had removed most of his clothing and was dressed only in shorts. Inside the store, he had left the gun, a tactical vest, a semiautomatic handgun and his bloodied clothing, the affidavit 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, the document said.

Authorities have not yet offered a possible motive for the bloodshed, which came six days after a gunman went on a killing spree in the Atlanta area, fatally shooting eight people at three spa businesses. Six of the victims were Asian women.

“It would be premature for us to draw any conclusions at this time,” Michael Schneider, the agent in charge of the FBI’s field office in Denver, said Tuesday.

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 told AP.

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 “got up in classroom, walked over to the victim & ‘cold cocked’ him in the head,” the affidavit read. Alissa complained that the student had made fun of him and called him “racial names” weeks earlier, according to the affidavit. He was sentenced to probation and community service.

The attack sent terrorized shoppers and employees scrambling for cover. It was the nation’s deadliest mass shooting since a 2019 assault on a Walmart in El Paso, Texas, where a gunman killed 22 people in a rampage that police said targeted Mexicans.

Hundreds of police officers from throughout the Denver metropolitan area responded Monday to the afternoon attack in a busy shopping plaza in southern Boulder. Officers were initially called to the King Soopers store over reports of a man shot in his vehicle, according to NewsNation affiliate KDVR-TV.

When officers arrived the suspect began shooting at them, police said.

Officers had their guns drawn, and some windows at the front of the store were broken. Authorities over a loudspeaker said the building was surrounded and that “you need to surrender.” They said to come out with hands up and unarmed.

Television helicopter video showed many law enforcement vehicles and officers outside the store and at least three helicopters on the building’s roof.

A shirtless man with blood running down his leg was later escorted out of the store in handcuffs by two police officers. Court documents released Tuesday night confirmed that was Alissa.

Police on Tuesday identified all 10 victims after naming a police officer, 51-year-old Eric Talley, who was killed in a shootout with the suspect. The victims ranged in age from 20 to 65.

“My heart goes out to the victims of this incident and I’m grateful to the police officers who responded,” said Boulder Police Chief Maris Herold.

Ofc. Eric Talley, 51 (Photo courtesy Boulder Police Department)

Talley was to determined to be one of the first officers to arrive at the scene. He’s been a member of the department since 2010.

“This is our community and we are heartbroken, absolutely heartbroken, for the pain and anguish that so many in our community and across our state are feeling today,” Rep. Joe Neguse said during a press conference Tuesday. “Ten lives lost, ten friends, neighbors, sisters, brothers, parents, colleagues, community members, families that are grieving today – woke up today without their loved ones, including an officer that bravely died in the line of duty protecting this community, Officer Talley – his service and sacrifice will never be forgotten.”

Witness Daniel Douglas said he was in the store grabbing lunch.

Douglas said a lot of people were crying.

“As we were waiting on the pizza and we started hearing gunshots. It sounded like someone was breaking the glass at first,” Douglas said. “We started screaming and hit the ground.”

“My nerves are so racked right now I’m having a hard time talking,” he said.

Another witness told KDVR that they had just left the store after checking out and heard what sounded like fireworks.

The witness said a guy was wearing tactical gear carrying an “AR-15 style weapon.”

The witness also said they ran back inside and told people about the shooter outside, ran into the back of the store and left through the delivery entrance. The witness also told KDVR that the shooter was in the parking lot, and they were unclear if he entered the store.

TV footage showed officers helping two people to safety.

Law enforcement SWAT teams from Jefferson County and Boulder were dispatched to the market.

“Not one is like the other but interestingly we’re seeing this again in Colorado where we saw Columbine and the movie theater shooting in Aurora that actually set new standards for how we respond to this,” former FBI Special Agent Phil Andrew told NewsNation.

Colorado Gov. Jared Polis issued a statement Monday on the events at the supermarket.

“Our community anxiously awaits more information on the victims, hoping it’s not our friends, coworkers and neighbors but knowing in our tight-knit community it will be, and even if we don’t personally know them, we all mourn their senseless killing and our sense of safety in our local grocery store,” he wrote.

The King Soopers chain said in a statement that it was offering prayers and support “to our associates, customers, and the first responders who so bravely responded to this tragic situation.”

President Joe Biden addressed the nation Tuesday, calling for a ban on assault weapons and tighter gun control measures.

“This is not and should not be a partisan issue,” Biden said. “It’s an American issue that will save lives, American lives. We have to act.”

Download the free NewsNation Now app to receive updates on this developing story.

The Associated Press and Reuters contributed to this report.