Updated

A man opened fire immediately on a San Diego police officer who walked up to him on a dark residential street last week to ask if he lived nearby, prosecutors said, then shot into a patrol car, hitting the officer's partner with five bullets as he sat wearing a seatbelt.

Jesse Gomez — a construction worker with two felony convictions — pleaded not guilty to murder and attempted murder charges at a hospital where he is recovering from wounds sustained in the gunbattle with police.

Deputy District Attorney Michael Runyon said at a news conference Tuesday that Gomez and another man had been walking about 11 p.m. Thursday and split up as the officers came into view. The two officers pulled up to Gomez, and Officer Wade Irwin got out and asked if he lived in the area.

Gomez "answered with gunfire," Runyon said, striking Irwin in the throat.

As Irwin fell down, he saw Gomez walk toward the open passenger door and fire multiple times into the patrol car, where Officer Jonathan DeGuzman sat in the driver's seat, Runyon said.

The fatal bullet went through both of DeGuzman's lungs and severed his spine, Runyon said.

After being shot in the throat, Irwin fired back as Gomez fled, Runyon said. Police later found Gomez by following a trail of blood to a ravine. He was unconscious with an empty holster, and police found a firearm, magazine and matching ammunition in the ravine, according to investigators.

Police have not determined a motive for the killing. They say they have not ruled out that the officers were targeted as in other cases across the country.

"We are all still shaken by this cold-blooded murder," District Attorney Bonnie Dumanis said. "An assault on a peace officer is an assault on our community."

Police arrested a second man on an unrelated warrant and who fit the description of the person walking with Gomez, Runyon said. Officials declined to say whether he is still a person of interest. He posted bail and has been released.

Gomez, 52, would be eligible for the death penalty if convicted, but prosecutors have not decided whether to seek it. Bail was set at $5 million.

DeGuzman, 43, was a 16-year veteran on the force with a wife and two children.

Investigators have reviewed police body camera footage, though they said at Tuesday's news conference that Irwin's camera was not turned on until after he was shot.

Irwin, 32, picked Gomez from a six-person photo lineup after undergoing surgery, authorities said.

Officials have released little information about Gomez. He has a criminal record stretching back to 1983, including a conviction for auto theft and drunken driving.

Prosecutors said he used a cane to seize a car from another driver.

He was convicted of firearm charges in 1992 and again in 2002 for carrying firearms while under the influence of methamphetamine.

Gomez grew up in a modest house in southeastern San Diego, about a half-mile from the site where the shooting occurred.

Real estate broker Leonard A. Marquez wrote in a 2002 letter to a judge that Gomez had worked for him for eight years. Marquez described Gomez as "a multi-talented worker who is considered to be a great asset to all construction projects."

Gomez's son, Daniel Gomez, told The San Diego Union-Tribune that he believes his father is innocent. He said he is a good father to his three sons and a dedicated grandfather to his 9-year-old granddaughter.

"I know he's been in trouble, like when I was a baby, but after that nothing," Daniel Gomez told the newspaper. "It's like he realized he had his kids in his life and he had to take care of them, so that's what he did. He stayed out of trouble and was about his family."

A memorial service will be held Thursday and a public funeral Mass on Friday for DeGuzman.

_____

Associated Press writer Elliot Spagat contributed to this report.

_____

This story corrects that Officer Jonathan DeGuzman was shot five times.