An armed man who walked into a Walmart store in Missouri dressed in body armor and fatigues and was detained at gunpoint by an off-duty firefighter is "lucky he's alive still" considering the situation he created, a police official said.

No shots were fired in the incident that happened just after 4 p.m. Thursday in Springfield, a city of around 160,000 in the southwestern part of the state, officials said.

Dmitriy Andreychenko, 20, was detained by the armed firefighter until police arrived at the Walmart Neighborhood Market, police said in a statement.

Download the NBC News app for breaking news and politics

Andreychenko had been seen pushing a shopping cart and recording video of himself on a cellphone, police told NBC affiliate KYTV.

Police were called about a possible active shooter, and the store manager pulled a fire alarm and told people to evacuate, Springfield police Lt. Mike Lucas said.

"He walked in here, heavily armed with body armor on, in military fatigues, and caused a great amount of panic inside the store," Lucas said about the incident that came days after mass shootings at an El Paso Walmart and an Ohio entertainment district that left more than 30 people dead. "... Obviously, what's happened in Texas and Dayton and all that kind of stuff in the last seven days — that’s on everybody’s minds."

It was not clear what motivated Andreychenko to enter the Springfield store.

The open carrying of firearms is legal in Missouri, as long as the weapon is not displayed in a threatening manner, according to the National Rifle Association’s website.

Andreychenko, 20, is facing a charge of making a terroristic threat, police said.

The man entered the store with a tactical rifle, a handgun and more than 100 rounds of ammunition, KYTV reported, citing police. He was said to have been stopped by the armed firefighter after leaving through an emergency exit.

Walmart said in a statement that "the behavior of a customer was concerning to those inside our store and out of caution, law enforcement was contacted."

When police arrived, there were "a lot of people hiding outside" behind barriers and businesses in a scene that "was pretty chaotic for a couple of minutes," Lucas said.

Tammy Lea told KYTV that she was in the checkout line when she saw people running from the store, "screaming there was a gunman in the store, shooter in the store."

"I am still shaking. It is just terrifying," she told the station.

Julie Belew told NBC News in a phone interview that she had parked and was about to get out of her car and go into the store when she heard someone yell, "is that a real rifle?" She said she then saw a man with his hands up.

Belew said that the first thing that came to her mind was Saturday's deadly shooting at the El Paso Walmart.

Police praised the firefighter's actions amid the chaos and panic created by the armed man.

"His intent was not to cause peace or comfort to anybody that was in the business here," Lucas said. "In fact, he's lucky he's alive still, to be honest."