Ten people, including a police officer, were killed on Monday in a mass shooting at a supermarket in Boulder, Colorado.
Police on Tuesday said a young man had been charged with 10 counts of murder.
"This suspect has been identified as Ahmad Alissa, 21," Boulder Police Chief Maris Herold said.
"He is charged with 10 counts of murder in the first degree and will be shortly transported to Boulder county jail."
Authorities also gave the names of the nine civilians who had been killed. They earlier identified police officer Eric Talley among the dead.
The victims ranged in age from 20 to 65, Ms Herold said.
US President Joe Biden said on Tuesday: "Ten lives have been lost and more families have been shattered by gun violence in the state of Colorado.
"I just can't imagine how the families are feeling, the victims whose futures were stolen from them from their families, from their loved ones, who now have to struggle to make sense of what happened."
The man was being treated at a hospital after being wounded in an exchange of gunfire with police.
He was expected to be booked into the county jail later on Tuesday, Boulder County District Attorney Michael Dougherty said.
Investigators do not yet know why the man opened fire inside the King Soopers grocery store, Mr Dougherty said.
He said the investigation was in the early stages but detectives believes the man was the only gunman.
The shooting at the crowded supermarket sent terrorised shoppers and workers rushing for safety and stunned a state and a nation that has grieved after several mass killings.
Law enforcement vehicles and officers massed outside the store, including Swat teams. Three helicopters landed on the roof.
Some windows at the front of the store were broken. At one point, authorities told the shooter over a loudspeaker that the building was surrounded and “you need to surrender”.
They told him to drop his weapon and come out with his hands up.
Sarah Moonshadow told The Denver Post that two shots rang out just after she and her son, Nicolas Edwards, finished buying strawberries.
Ms Moonshadow said she told her son to get down and then “we just ran”.
When they made it outside, she said they saw a body in the car park.
Mr Edwards said police were speeding into the lot and pulled up next to the body.
“I knew we couldn’t do anything for the guy,” he said. “We had to go.”
James Bentz told The Post that he was in the meat section when he heard what he thought was a misfire, then a series of pops.
“I was then at the front of a stampede,” he said.
Mr Bentz said he jumped off a loading dock at the back to escape and that younger people were helping older people to climb down from it.
"My heart goes out, our hearts go out to the survivors, who had to flee for their lives and who hid, terrified, unsure if they would ever see their families again or their friends again," Mr Biden said.
"The consequences of all this are deeper than I suspect we know."
Vice President Kamala Harris also commented on Tuesday
“It's absolutely tragic,” Ms Harris said. “It’s 10 people going about their day, living their lives, not bothering anybody.
"A police officer who is performing his duties, and with great courage and heroism.”
Colorado Governor Jared Polis tweeted that his “heart is breaking as we watch this unspeakable event unfold in our Boulder community".
Boulder police told people to shelter where they were after a report of an “armed, dangerous individual” about five kilometres away from the grocery store.
The FBI said it was helping in the investigation at the request of Boulder police.
Kevin Daly, owner of a restaurant about 100 metres from the supermarket, said he saw police cars arriving and shoppers running from the grocery store.
Mr Daly said he took in several people to keep them warm. Others boarded a bus provided by Boulder police and were taken away.
A month ago Mr Biden called on Congress to enact "common-sense" gun law reforms.
On Tuesday he called for Congress to pass a ban on assault weapons.
This is not the first mass shooting to hit the state which has been the scene of two of the most well known and deadly shootings in the US, at Columbine High School and the Aurora theatre.