SIOUX FALLS, S.D. (AP) — South Dakota Attorney General Mark Vargo said Friday that a police officer and sheriff’s deputy were justified in shooting and killing a man in a Sioux Falls Burger King parking lot earlier this month.

The state’s Division of Criminal Investigation reviewed the Aug. 9 shooting and found that James Michael James, 21, had reportedly shot at the Minnehaha County Sheriff’s deputy three times. The police officer and deputy returned fire. James was shot four times.

He was transported to the hospital where he was pronounced dead.

The attorney general’s office said that the law enforcement officers were surveilling an area known for drug trafficking when they saw a car with four people conduct what “appeared to be illegal drug activity.”

The Division of Criminal Investigation reported that police officers stopped the car, and it pulled into the Burger King parking lot, where James and another man jumped out of the car and ran. While the other man fled from the officers, James pulled a gun from his waistband and fired at the officers.

Both officers returned fire, together shooting 21 times, as James continued to fire at them.