The incident unfolded in a Lancaster, California parking lot on June 20.
According to the Los Angeles County Sheriff's Department, a man was gunned down after stabbing a police officer.
A concerned citizen had called authorities to report a person swinging knives in public, prompting a police response.
Surveillance video shows three sheriff's patrol vehicles arriving at the scene to confront the man, identified as Robert Castro.
Castro is seen walking away from the deputies, who pursued him in the parking lot.
When the first deputy confronted Castro, he turned and stormed toward the police car, attacking the officer with a knife.
Fearing for his life, the deputy shot Castro several times, causing him to collapse to the ground.
A second deputy arrived to help his partner, who had suffered a stab wound.
The second deputy also fired several shots when Castro reached for his knife on the ground.
The deputy repeatedly yelled at Castro to stop moving and not reach for the knife.
Castro eventually stopped moving on the ground.
Both Castro and the injured deputy were taken to a hospital, where they received treatment.
Castro was pronounced dead at the hospital, while the deputy received treatment for his stab wound.
The Los Angeles County Sheriff's Department released a statement confirming the sequence of events in the body-cam footage.