Police have arrested a man accused of shooting three people at a Walmart in suburban Colorado after a manhunt.
Scott Ostrem, 47, "nonchalantly" walked into the store and opened fire on Wednesday night, officers said.
Two men were killed at the scene of the shooting and a wounded woman was taken to hospital, where she later died.
Police said it took several hours to identify the gunman on CCTV, as several other armed citizens drew their weapons when gunfire broke out.
Thornton Police Department spokesman Victor Avila said: "We had to be able to discern what exactly was going on - whether that was a suspect or whether that was a citizen truly worried about what was going on at the sound of gunshots".
The coroner's office named the three victims as Pamela Marques, 52, Carlos Moreno, 68, and Victor Vasquez, 26.
Mr Vasquez had two young daughters and had been expecting another child, according to an online fundraiser set up for his family.
'It's a crazy world'
Police say Mr Ostrem "randomly" opened fire, before fleeing in a red car from a suburban Walmart supermarket in Thornton, 10 miles (16km) north-east of the state capital of Denver.
Mr Ostrem was identified as the gunman on Thursday morning. He has had previous run-ins with police dating back to 1999, the Denver Post newspaper reported.
Mr Avila said there was no indication of a motive at this stage.
"He walked in very nonchalantly with his hands in the pockets, raised a weapon and began shooting," Mr Avila said.
"From what we have right now it appears to be random," he added. "It's a crazy world we live in."
'He made me nervous'
Neighbours of Mr Ostrem told the Post that they found him to be "creepy".
"He made me nervous because he always had rifle in a case over his shoulder," said Teresa Muniz, who lives in the same apartment building as the suspect.
In 2015 he filed for bankruptcy protection after amassing more than $58,000 (£44,000) in credit card debt, federal records show.
Employees at the sheet metal fabricator B&M Roofing, where Mr Ostrem worked, told TV network Denver 7 that he was a "good employee" and he had been there earlier on Wednesday before the shooting.
Police said Mr Ostrem was arrested after an anonymous tipster called police to report seeing the suspect's 2017 Mitsubishi Mirage near his apartment.
Swat officers detained him "without incident" after detonating a flash-bang explosive device to distract him as his car idled at a traffic light.
Nearly 50 witnesses were transported by police vans to the Thornton Police Department headquarters, where they were later reunited with family members.
Guadalupe Perez was with her son Erick, and first thought the gunshots were the sound of popping balloons.
"We were renting movies and we just heard this popping noise," she told CBS Denver. "The Walmart girl said: 'The balloons are popping.'"
"And I turn around, I just see all the people walking, falling down because they were really scared."
A spokesman for Walmart says that no employees were injured and that the company was "deeply saddened by this tragic event".