FREMONT (KPIX 5) – Fremont police on Friday were poring over hours of body-camera and dashboard-camera video after officers shot and killed a man who fired a handgun at a passing patrol Thursday night.

Investigators pledged the name of the gunman as well as the officers involved in what the police department is describing as an ambush-style attack.

READ MORE: Solano County Sheriff Slammed Over Response To Claim Some Deputies Belong To Extremist Groups

The suspect allegedly fired at an officer at about 10:50 p.m. as he was driving his patrol vehicle on Civic Center Drive south of the Mowry Avenue intersection, police said.

As the officer was heading south past the driveway to the Washington Hospital emergency room, the suspect allegedly walked toward the officer’s car from the east side of Civic Center Drive, pointed a handgun at him and opened fire, striking the officer’s vehicle at least once, according to police.

Investigators said the officer made a U-turn, stopped his car, grabbed his rifle and shot and hit the suspect.

READ MORE: Slow Recovery Prompts Businesses to Rethink Their Future in Downtown San Francisco

Moments later, police say two other officers arrived on the scene and found the suspect shot but unwilling to surrender.

Scene of a fatal shooting involving Fremont police near Washington Hospital on April 18, 2019. (CBS)

Scene of a fatal shooting involving Fremont police near Washington Hospital on April 18, 2019. (CBS)

“The suspect crawled towards the firearm — actually grabbed onto the firearm. He pointed it at our officers. And both of our officers fired at the suspect,” Capt. Fred Bobbitt said.

Police say the suspect was eventually taken into custody with the help of a police dog and given first aid but died at the scene.

MORE NEWS: Gunman Kills 8 In Indianapolis FedEx Workplace Mass Shooting

No officers or civilians were injured during the firefight, which lasted about 17 minutes, according to police.