SAN DIEGO -- A San Diego man was charged Tuesday with murder and attempted murder in the shootings of two San Diego police officers, and prosecutors revealed he opened fire immediately after being asked if he lived in the area where he was walking.

Jesse Gomez pleaded not guilty in an arraignment held at the hospital as he recovered from wounds sustained in the gun battle with police.

About 11 p.m. Thursday, Gomez and another man had been walking and split up when they saw the officers, Deputy District Attorney Michael Runyon said at a news conference. 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.

Get Breaking News Delivered to Your Inbox

He shot Irwin, who survived, then fired in the car where Officer Jonathan DeGuzman sat with his seatbelt still on, Runyon said. DeGuzman was hit four times and killed.

Gomez is eligible for the death penalty, but prosecutors have not decided whether to seek it.

Neither police nor prosecutors would say anything about a motive for the shooting.

Gomez was found in a ravine shortly after the shootings when officers followed a trail of blood, authorities said.

DeGuzman, 43, died after being rushed to a hospital. Irwin, 32, is recovering from his wounds at a hospital.

A second man was arrested Friday on an unrelated search warrant, but he has been released, authorities said.

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

Officials have released little information about Gomez. The construction worker 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 in 1983. 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 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 him 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 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.