THORNTON, Colo. -- An arrest has been made in a shooting that left three dead at a Colorado Walmart Wednesday night, police said on Twitter.

Police said a man nonchalantly entered the store in Thornton and fired a handgun into a group of people before fleeing in a car. Two men died at the store, and a woman died at a hospital.

CBS Denver video shows Scott Ostrem being handcuffed and put in a police car just before 8 a.m. Thursday. Ostrem, 47, was identified Thursday morning as the suspect in the shooting, about 14 hours after the incident. Authorities had said he should be considered armed and dangerous.

Scott Ostrem during his arrest in Westminster, Colo. CBS Denver

The Walmart is located about 10 miles north of Denver in a busy shopping center.

Get Breaking News Delivered to Your Inbox

Police executed a search warrant on Ostrem's apartment in Denver Thursday morning, Thornton police spokesman Victor Avila said, but Ostrem wasn't home. Officers then received an anonymous tip that he had been seen driving nearby in Westminster.

Police pulled the car over and Ostrem was arrested without incident. He admitted his identity to investigators, Avila said.

Avila said Wednesday night that the shooting appears random and that the motive remains unknown.

"This is a very heinous act," Avila said. "We don't know exactly what the motive of the person was, but it was certainly a terrible act."

Avila on Thursday described a chaotic scene inside the Walmart after the shooting. He said hundreds of people were fleeing the Walmart as police attempted to cordon off the area, not sure of the gunman's identity. He said it was several hours until the scene was safe enough for a Walmart employee to re-enter the store to obtain surveillance footage, which in turn helped investigators identify Ostrem.

Thornton, Colorado police released this surveillance image of Scott Ostrem as they searched for him in connection with a fatal shooting at a Walmart Nov. 1. Ostrem was taken into custody the next day. Thornton Police via CBS denver

Aaron Stephens, 44, was in the self-checkout line when he heard a single shot followed by two more bursts of gunfire before people started running for the exits.

"The employees started screaming. Customers were screaming. They were running like crazy, and I ran out too because I didn't want to get killed," he said.

Guadalupe Perez was inside the store with her young son when she heard what she thought was a balloon popping. A Walmart employee told her someone was shooting, and then Perez saw people running away yelling, "Let's go. Let's go. Leave the groceries."

"You see all these things in the news and you go through it, it's scary," she said. "But thank God we're OK and nothing happened to us."

Investigators, including special agents with the Bureau of Alcohol, Tobacco, Firearms and Explosives, were reviewing security video and interviewing witnesses.

Ragan Dickens, a Walmart spokesman, said the company is working with investigators.

Authorities did not immediately release any other information about the victims.

Avila said Ostrem had a minor criminal history but did not elaborate. Court records show a charge of resisting arrest against Ostrem in 1999 was dismissed. Records also show Ostrem filed for bankruptcy in 2015.

Ostrem worked for a Denver-based roofing company as a field employee until 2014, said Sandra Runyon, an administrative assistant at Tecta America Colorado Commercial Roofing. Runyon said the company had had no contact with Ostrem since he left. She didn't provide additional details.

Residents of the apartment building where Ostrem lived in a third-floor unit described him as unfriendly and occasionally hostile.

Teresa Muniz, a 54-year-old meat processor, said most tenants in the building are friendly with each other but Ostrem never returned her greetings. Several times, he swore at people for sitting in the outdoor stairways or leaving laundry in communal machines, she said.

"He wasn't a friendly person," Muniz said. "It has to be a really lonely life, and he didn't seem to have anybody. Being angry all the time. That's what he seemed like, always angry."

Muniz said she sometimes saw Ostrem carrying a bow and set of arrows or a shotgun into or out of his apartment.

Gerald Burnett, a 63-year-old retiree who lives in a first-floor unit, said he was sitting on the stairs drinking coffee one morning when Ostrem came down the steps. Ostrem told him to move and cursed at him, Burnett said.

"Dude had an attitude, big time," Burnett said. "He's the type of person if you said 'good morning,' he wouldn't say nothing. If you greeted him, he wouldn't say anything back. I just learned not to even talk to the clown."