SPRINGFIELD, Mo. — A man who caused panic at a Missouri Walmart when he walked inside wearing body armor and carrying loaded weapons in what he described as an effort to test his right to bear arms pleaded guilty to making a false report Friday after initially being charged with a more serious terrorist-related felony.

Dmitriy Andreychenko, 21, pleaded guilty to an amended misdemeanor charge after originally being charged with making a terrorist threat.

Police arrested Andreychenko on Aug. 8 after he filmed himself walking through the store with the weapons, prompting shoppers and employees to leave. The incident came just days after 22 people were killed during an attack at another Walmart in El Paso, Texas. An off-duty firefighter held Andreychenko at gunpoint until officers arrived.

Greene County Prosecuting Attorney Dan Patterson said in a news release Friday that Andreychenko didn’t intend to carry out a shooting, but was conducting what he called a “social experiment” in the wake of the Texas shooting and another mass shooting in Dayton, Ohio. The release said Andreychenko had researched both shootings and saved the alleged manifesto of the El Paso shooter on his phone. On the day before the shooting, he posted a picture to Snapchat of a family member wearing his body armor looking down the sights of a rifle with the caption, “Watch out Walmart.”

Under the terms of the plea, he was ordered to serve 48 hours of shock incarceration and two years of probation. He also must receive firearm training, Patterson said the release. The making a terrorist threat carried a sentence of up to four years in prison.

Andreychenko’s attorney, Dee Wampler, said in a statement released Friday in advance of the plea that Andreychenko is a strong supporter of the Second Amendment.

“His intention was to make a statement of his right to openly carry a firearm, which was legal but — for which he now admits was ill-timed given a recent Texas Walmart shooting,” the statement said. “It was a very bad idea which he now regrets. Regardless of how it looked, he never intended to harm or frighten anyone and merely saw it as a way to exercise his rights.”

During an interview with KYTV in August, Andreychenko said the act was “foolish” and “innocent,” but he did not regret his actions.

Andreychenko started to record himself with his phone while he was still in the car parked at Walmart. He got the body armor from the trunk of his car and put it on before grabbing a shopping cart and walking into the store, according to the probable cause statement.

Andreychenko said his intention was to buy grocery bags. The rifle had a loaded magazine inserted, but a round was not chambered. A handgun on his right hip was loaded with one round in the chamber.

“I wanted to know if Walmart honored the Second Amendment,” the probable cause statement quoted Andreychenko as saying.

His wife, Angelice Andreychenko, told investigators that she warned him it was not a good idea, adding that he was an immature boy. His attorney added in Friday’s statement that he should have listened to his wife’s advice.

The probable cause statement does not allege that he pointed the weapons at anyone, although patrons in the surveillance video could be seen in the background running away.

Walmart said in a statement following the incident that it allows concealed and open carry in stores if it is legal in the jurisdictions where the stores are located. It later said it was requesting that customers refrain from openly carrying firearms at its Walmart and Sam’s Club stores unless they are law enforcement officers. However, it said that it won’t be changing its policy for customers who have permits for concealed carry. Walmart says it will be adding signage in stores to inform customers of those changes.

Since January 2017, Missouri has not required a permit to openly or conceal carry a firearm for those 19 years or older. Roughly 30 states allow the open carrying of handguns and rifles and shotguns in public without a permit.

Springfield is about 165 miles south of Kansas City, Missouri.