San Diego
San Diego police officers investigate the scene where an officer was fatally shot and another was injured at a traffic stop in San Diego Mike Blake/ Reuters

Two police officers in San Diego have been shot, one fatally, following a traffic stop, in the south of the city.

The officers, who worked for the police department's gangs unit, were taken to hospital following the shooting, with one confirmed dead by the department. Another underwent surgery and is expected to survive.

One suspect was arrested in connection with the shooting, which took place around 11pm local time on 28 July, and is being held in custody.

In a tweet, San Diego Police Department's chief of police, Shelley Zimmerman, wrote: "It is with a very sad heart that we announce the death of one of our Officers tonight. Pray for his family."

She also said the second officer had come out of the operation and was expected to recover from his injuries, and said it was not yet known whether the men had been ambushed, ABC News reported.

The shooting comes less than two weeks after an attack on police in Baton Rouge, where three officers were fatally shot by a gunman who reportedly wanted to shoot white officers amid escalating tensions between law enforcement and the public.

Since the shooting, police departments around the US have been on high alert, although it is not known what the motive for the San Diego shooting was.