Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

San Diego police on Friday took into custody a second person after a police officer was fatally shot and another officer was wounded in gunfire that erupted following a stop the night before.

Police identified a man arrested earlier, Jesse Michael Gomez, 52, and said he was responsible for the killing of Officer Jonathan DeGuzman and the wounding of Officer Wade Irwin.

The second person was arrested on an outstanding warrant hours after a SWAT team surrounded a home Friday morning — but Zimmerman cautioned he was only a “potential suspect.”

“At this time we have not determined if [the person in custody] is involved in the murder of Officer DeGuzman and the attempted murder of Officer Irwin,” San Diego Police Chief Shelley Zimmerman said Friday afternoon.

It is with a very sad heart that we announce the death of one of our Officers tonight. Pray for his family pic.twitter.com/3l9PXa1vuW — San Diego Police (@SanDiegoPD) July 29, 2016

DeGuzman was a married father of two young children. Irwin, a nine-year veteran of the San Diego Police Department, was wounded.

"He is now awake, and we continue to expect a full recovery," Zimmerman said of Irwin.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The officers, both members of the gang suppression unit, encountered the gunman on the street at about 11 p.m. local time Thursday (2 a.m. Friday ET) in the city's Southcrest neighborhood, Zimmerman said, although investigators were determining whether it was a traffic or pedestrian stop.

San Diego Police Department Officer Jonathan DeGuzman is seen in this photo provided by the SDPD. The married father of two was fatally shot and another officer was wounded late Thursday, July 28, 2016. SDPD

Almost immediately, the officers — who were in uniform and were driving a marked car — called for emergency cover, she said.

Other officers arrived at the scene and found that the pair had each been shot in the upper torso. DeGuzman was struck multiple times and died at the hospital.

Irwin was rushed to the hospital. The department later tweeted that he was "expected to survive."

Officers set up a perimeter around the crime scene and were able to locate the suspected shooter, who also had a gunshot wound to the upper torso.

He was not immediately identified, but was described as a Hispanic male. Zimmerman said he was in the hospital in critical condition. Police later said Gomez was arrested for murder and attempted murder.

The officers were wearing body cameras during the incident, she added.

Sources told NBC News that he and other suspects may belong to a local gang. There was no early indication that the officers were specifically targeted as in recent police ambush attacks in Dallas and Baton Rouge, Louisiana, the sources said.

Zimmerman said the investigation into the shooting was ongoing, and that the department was "heartbroken" and would be mourning DeGuzman, the first San Diego officer to die in the line of duty since 2011, according to NBC San Diego.

"I can’t begin to put in words the emotions and feelings that surround an event like this," Zimmerman said. "This is one of the most difficult and heart-wrenching situations for police officers to go through."

The police chief said she had worked with DeGuzman while she was a lieutenant in the Mid City Division.

"He came to work every single day wanting to make a positive difference in our community," Zimmerman said.

San Diego Police SWAT officers prepare to enter a house with a possible suspect inside Friday, July 29, following the fatal shooting of a police officer and the wounding of another officer. A second person was arrested but has not been linked to the shootings. Denis Poroy / AP

She lamented the recent police killings across the country, saying that cops "wear a badge with pride ... and to have this happen to our police officers, we have seen this happen way too many times just in the past few weeks."

San Diego Mayor Kevin Faulconer condemned the shooting, tweeting that officers in the city need the community's support. Flags at all city properties were ordered flown at half-staff.

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

Republican presidential nominee Donald Trump, who has declared himself the "law and order candidate," weighed in on the shooting Friday. He tweeted that "it is only getting worse. People want LAW AND ORDER!"