San Diego police were trying to determine whether a shooting that killed a veteran officer and wounded another was a deliberate attack.

Jonathan DeGuzman, a 16-year veteran of the force, died Thursday night when a gunfight erupted after he and his partner stopped someone on a street in a blue-collar area of town.

Hours later, a trail of blood led to a wounded suspect who remained hospitalized in critical condition, while a second man described only as a potential suspect was captured after an hours-long SWAT standoff Friday.

San Diego's mayor and police chief planned to answer media questions at noon Saturday at the hospital where the wounded officer is recovering.

The death of DeGuzman, 43, came as departments around the country are on high alert following the killing of officers this month in Dallas and Baton Rouge, Louisiana.

The chain of events started about 11 p.m. Thursday when DeGuzman and Wade Irwin, 32, stopped someone in a southeastern neighbourhood, although it wasn't immediately clear whether the gang officers stopped a pedestrian or a car, police said.

Almost immediately a shootout ensued and the officers called for backup.

"We're talking very, very quickly. Seconds to a minute or so," Police Chief Shelley Zimmerman said.

Both men were wounded despite wearing bulletproof vests.

Zimmerman said it was unknown whether the San Diego attack was premeditated. She also said video was recovered from the officers' body cameras.

DeGuzman died at a hospital. Irwin, a nine-year veteran who had joined the gang suppression unit in June, underwent surgery with his wife at his side, Zimmerman said.

"The good news is that he is going to survive and he is going to recover," Zimmerman said.

Police swarmed the neighbourhood where the shootout happened. About a half-hour after the shooting, they followed a trail of blood to a ravine and found Jesse Gomez, 52, with a chest wound.

He was in critical condition Friday but was expected to survive. Police gave no further information about Gomez or his role in the shootout except to say he was a suspect.

During the search for a second man described as a "potential" suspect, residents were ordered to stay in their homes throughout the night as San Diego police and officers from other law enforcement agencies scoured yards, streets and alleys. A helicopter hovered over the neighbourhood.

About nine hours after the shootout, heavily armed officers surrounded a house about a half-mile (about 1 kilometre) away, one of them using a loudspeaker to urge a man they called "Marcus" to surrender. Authorities also detonated several gas bombs at the scene to draw him out and used tools to break windows and pound on the roof.

Then, about a dozen heavily armed SWAT officers raced to another house about two blocks away, positioning an armoured truck and robots outside. The possible suspect wasn't there either.

Marcus Antonio Cassani, 41, was finally found several blocks away and held on an Anaheim arrest warrant.

Zimmerman said police were investigating whether Cassani, who has a criminal record that includes drug, weapons and burglary convictions, had any role in the police shootings.

Zimmerman told reporters that she went to DeGuzman's home to tell his wife and two children of his death.

"I can tell you he is a loving, caring husband, father. Talked about his family all the time," Zimmerman said. "I know him, and this is gut-wrenching. He cared. He came to work every single day wanting to just make a positive difference in the lives of our community and that's why he lost his life."

DeGuzman received the purple heart in 2003 after he was stabbed by a man he had stopped for speeding. The man was convicted of attempted murder on a peace officer in 2004.

He was the 33rd San Diego police officer killed in the line of duty since 1913.

San Diego Mayor Kevin Faulconer denounced the latest shootings.

"Violence against the men and women who wear the badge is violence against us all," he said.