Ten people have been killed in a shooting at a supermarket in Boulder, Colorado, including a police officer who was first on the scene.
Eric Talley, 51, was named as the officer killed at the King Soopers store in the Table Mesa area of the US city on Monday afternoon.
He was first on the scene following a call about shots being fired and someone carrying a rifle, police chief Maris Herold told a news conference.
A suspect was detained and is receiving medical treatment, authorities said.
Boulder Police Department tweeted to pay their respects to Mr Talley, who had been with the force since 2010.
The tweet said: “Rest In peace Officer Eric Talley. Your service will never be forgotten.”
Boulder County district attorney Michael Dougherty said Mr Talley was an “outstanding” officer.
“He was by all accounts one of the outstanding officers of the Boulder Police Department, and his life was cut too short,” Mr Dougherty said.
He described the incident as a “tragedy and a nightmare”, adding: “These were people going about their day, doing their shopping. I promise the victims and the people of the state of Colorado that we will secure justice.”
A witness told the Associated Press he heard gunshots and saw three people lying face down on the ground, adding that he “couldn’t tell if they were breathing”.
Video posted on YouTube showed one person on the floor inside the store and two more outside on the ground, but the extent of their injuries was not clear.
Another witness, Sarah Moonshadow, 42, told Reuters that shots rang out just as she and her son Nicholas reached the checkout.
Ms Moonshadow recounted seeing “someone laying in the road” as she and her son fled the store.
She added: “And I tried to run towards him, and Nicholas pulled me away and he said, ‘We have to go.’ And we just ran and hid behind the building.”
Further footage from the scene broadcast by US television stations showed a shirtless, bearded man in boxer shorts being led away from the store in handcuffs. It is unknown if this was the suspect.
SWAT teams and at least three helicopters were sent to the scene after the violence unfolded around 3pm.
Boulder Police did not give further details about the shooting or a possible motive.
Identities of the other nine victims have not yet been disclosed as police were still notifying their family members.
Matthew Kirsch, the acting US attorney for Colorado, pledged that “the full weight of federal law enforcement” will be used support the investigation. The FBI also said it is assisting.
Earlier, Colorado governor Jared Polis tweeted to say he was heartbroken by the incident.
He said: “My heart is breaking as we watch this unspeakable event unfold in our Boulder community.”
He called it “very much an active situation” and said the state was “making every public safety resource available to assist the Boulder County Sheriff’s Department”.
White House press secretary Jen Psaki tweeted that President Joe Biden had been briefed on the incident.
In a statement, the King Soopers chain offered “thoughts, prayers and support” to those affected.
The attack was the seventh mass killing this year in the US. It comes less than a week after eight people were killed, including six Asian women, in shootings at massage parlours in and around Atlanta, Georgia.
A 21-year-old man has been charged with those killings.