US police say 10 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 city on Monday afternoon.
He had been with Boulder police since 2010, police chief Maris Herold told a news conference.
A suspect was detained and is receiving medical treatment, authorities said.
Boulder County district attorney Michael Dougherty described the incident as a "tragedy and a nightmare".
He added: "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."
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.
The FBI said it is helping with the investigation.
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.
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.