Updated

A gang member with a long criminal history who is believed to have ambushed a Southern California sheriff's deputy this week was left dead Wednesday after a shooting that also injured two police officers, authorities said. 

Officers with the San Bernardino Police SWAT unit were attempting to take the unidentified suspect into custody in connection with the deputy shooting just before 3:40 p.m. when gunfire erupted, San Bernardino police Lt. Michele Mahan told reporters. 

"Two of our officers were shot," Mahan said. "Both of them were able to speak at the time our own officers transported them to a local hospital."

Two San Bernardino police officers were injred Wednesday in a shooting that left another person dead. The incident came a day after a sheriff's deputy was attacked while trying to pull over a vehicle nearby. 

Two San Bernardino police officers were injred Wednesday in a shooting that left another person dead. The incident came a day after a sheriff's deputy was attacked while trying to pull over a vehicle nearby.  (KTTV)

The suspect, identified as Ervin Olikong, who had been under surveillance for several hours Wednesday, was pronounced dead at the scene. The incident occurred in the city of Highland, 66 miles east of Los Angeles. The officers' injuries were not disclosed but they are expected to survive, Mahan said. 

Olikong, 34, was a gang member with previous arrests for robbery and assault with a deadly weapon, San Bernardino Police Chief Eric McBride told reporters Wednesday night. At the time of his death, he had an open 2019 warrant for assault with a deadly weapon, he said. 

"Obviously this is someone who we don't want out in the streets," McBride said. "We don't know why he engaged the officer in that ambush of that deputy yesterday."

The incident came a day after a San Bernardino County Sheriff's deputy was shot while trying to pull over a motorist. The deputy was fired upon as he turned a corner during a brief car chase, authorities said. He remains hospitalized in stable condition. 

"He was able to immediately get out of his vehicle and as the deputy tried to catch up… he was able to retrieve a rifle from the vehicle," San Bernardino police Sgt. Equino Thomas told Fox News. "As the deputy turned, the suspect fired multiple rounds."

"Based on the actions of that suspect, he did, he ambushed that deputy," he added. 

The deputy's patrol SUV was found torched at the scene. Investigators are still trying to determine how the vehicle caught fire. He could be released from the hospital in the next few days, San Bernardino County Sheriff Shannon Dicus said. 

Two San Bernardino police officers were injured Wednesday, a day after a sheriff's deputy was attacked while trying to pull over a vehicle nearby. 

Two San Bernardino police officers were injured Wednesday, a day after a sheriff's deputy was attacked while trying to pull over a vehicle nearby.  (KTTV)

CLICK HERE TO GET THE FOX NEWS APP

During a search of an apartment complex Tuesday night, authorities recovered the suspect's vehicle and the rifle used in the attack, which matched bullet casings found at the scene. 

McBride noted that attacks against police officers have increased.

"Here we are in two days having three officers shot in the city of San Bernardino and the local area," he said. 
I think there's been some failures in our criminal justice system as far as keeping these people off the streets and it's manifested itself in assaults and deaths of police officers."