SAN DIEGO — San Diego police released bodycam video Thursday of the moment an officer shot an armed suspect who then shot a K-9, leaving both dead, authorities say.

The video begins with a recording of a call between a man and an SDPD dispatcher around 1 a.m. on Aug. 2. The driver says he had been followed and shot at by people inside a white Tesla on Ben Street.

“They got out of the car and just started shooting,” the man is heard saying, adding that his front and rear windows were shot out.

The video continues with footage from a private dash camera, which captured the moment two people opened the Tesla’s doors and started shooting at the other car. The Tesla then reverses out of sight.

When officers located the Tesla in the alley behind the 7400 block of Armstrong Place, only its driver was inside, police said. Officers saw that the driver, 33-year-old Benjamin Pickens, had a firearm. Pickens drove off, and officers lost sight of him.

Using GPS data to find the Tesla, officers drove to 7250 Mesa College Circle, where they found the car had been in a crash. Bodycam video from the canine officer shows officers searching the car. Police say they did not find any occupants or the gun inside.

An SDPD helicopter and officers found Pickens walking in the area.

In another officer’s bodycam video, you can see the officer trying to communicate with Pickens, who had a handgun under his left arm while talking on the phone with his right hand, according to police.

More bodycam video from the canine officer shows him send his K-9, Sir, towards Pickens, who pointed his handgun towards officers, according to police. Another officer fired his rifle, hitting Pickens in the chest. Pickens then fired his gun, striking the K-9.

A second K-9 was sent to move Pickens away from the firearm, police said. Officers then handcuffed Pickens and started medical aid before he was taken to a hospital, where he was pronounced dead.

Police say “officers were positioned too far away from Pickens to effectively deploy bean bag rounds.”

The San Diego County Sheriff’s Department Homicide Unit will investigate the police shooting, which will then be reviewed by the San Diego County District Attorney’s Office to determine whether the officers bear any criminal liability.