GILROY (CBS SF) — A man shot dead by a Gilroy police officer Wednesday was wanted for attempted murder and had called police to purportedly turn himself in, only to open fire on an officer who arrived at his location, police said Friday.

The suspect was identified as 40-year-old Gilroy resident David Lopez. Gilroy police said Lopez was suspected in a August 31 shooting on the 8500 block of Wren Ave. where the victim was shot multiple times at close range. The victim survived the shooting.

READ MORE: UPDATE: Thousands Forced To Flee Fawn Fire; New Evacuations Ordered South Of Shasta Lake

Scene of fatal police shooting outside a U.S. Post Office at Fourth and Eigleberry streets in Gilroy, September 8, 2021. (CBS)

A warrant for Lopez’s arrest was issued on September 1, police said. On Wednesday, police dispatchers received a 911 call from a person identifying himself as Lopez, saying police were looking for him, and that he would be waiting at the post office at 100 Fourth St. in Gilroy. The caller said he was unarmed and intoxicated, and that he would remain on the line with the dispatcher until officers arrived, police said.

The first officer on the scene, knowing Lopez was wanted for attempted murder with a firearm, used her vehicle’s PA system to tell Lopez to lie on the ground, but instead he opened fire on the officer with at least one bullet hitting the vehicle, police said. The officer was able to get out of the car and return fire. During the exchange, Lopez discarded his handgun and pulled out a second handgun which he tried to use against the officer, police said.

Handguns recovered from suspect killed in Gilroy police shooting. (Gilroy Police Department)

As he tried to shield himself behind a concrete pillar, Lopez was struck with at least one bullet from the officer, police said. He was later pronounced dead at a hospital.

READ MORE: PG&E Charged With Manslaughter For Sparking Zogg Fire That Killed 4

Police said the entire gunfire exchange lasted less than one minute and a combined total of seven rounds were fired. No one else was injured during the incident.

The Gilroy Police Department’s Investigations Bureau and Internal Affairs Division were investigating the shooting along with the Santa Clara County District Attorney’s Office. The county Medical Examiner-Coroner’s office is also conducting an investigation to determine the cause of death.

Gilroy police said the department would provide a detailed release of information about the incident, including video from body-worn cameras, in-car cameras, and 911 audio once it is compiled.

MORE NEWS: Three Charged With Allegedly Ripping Off $2 Million In EDD Unemployment Benefits

Anyone with information was asked to contact Detective Christopher Silva at (408) 846-0335. Anonymous tipsters can also call 408-846-0330.