LENOIR, N.C. (AP) — A Lenoir police officer was justified in fatally shooting a gun-toting man at a northwest North Carolina Walmart store, adding the officer prevented bystanders from being hurt, the local district attorney said.

District Attorney David Learner reached his conclusion after reviewing videos captured by the store and police body cameras, multiple media organizations reported. Learner said preliminary toxicology tests also found amphetamines and methamphetamine in the bloodstream of 32-year-old Carl Marcus Nivens, who was killed.

The Lenoir resident was a suspect in a vehicle break-in outside the store and was shooting at police Sgt. Brett Ingram, who returned fire and killed Nivens, Learner said. Ingram and another police officer who had been on the scene of Tuesday’s shooting had been placed on administrative leave, which is standard practice. They returned to duty on Friday.

“The officers’ decisions to use deadly force were fully justified and undoubtedly avoided injury to the officers and innocent bystanders,” Learner said in in a statement Friday. “Nivens was actively shooting at Sgt. Ingram who returned fire, killing the suspect.”

Both Nivens and Ingram were white. Two others who were with Nivens were arrested on outstanding warrants for unrelated charges.

Officers responded to the Walmart after employees reported suspicious activity. Nivens tried to flee from the store as officers tried to question him about the possible vehicle break-in, Police Chief Scott Brown said last week. Nivens pulled a .38 caliber revolver from his waist band and fired at least one shot at police, Brown said.

Other than minor injuries from struggling with Nivens, no officers were hurt and no other injuries were reported, Brown said.