A man with a loaded rifle and 100 rounds of ammunition walked into a Walmart in Springfield, Mo., on Thursday afternoon, alarming shoppers before he was detained by an armed off-duty firefighter and arrested by the police, according to the authorities and local news media.

No shots were fired, and it was not clear what the man, who is in his 20s and whose name was not immediately released, was planning to do inside the store, Lt. Mike Lucas of the Springfield Police Department said.

Lieutenant Lucas told The Springfield News-Leader that the man had intended “to cause chaos.” In an emailed statement, the Police Department said, “We are working to determine his motives.”

“Nobody was harmed, thankfully,” Lieutenant Lucas told reporters at the scene. “Just a really scary, dangerous situation that thankfully got resolved, and everyone’s going home tonight.”