"It pisses me off. It dismays me at the same time," he said.
The department shared video of the shooting in a Twitter post showing a person open fire through the passenger-side window of the patrol car.
"The gunman walked up on the deputies and opened fire without warning or provocation," the department stated.
The video sparked thousands of reactions, including from President Donald Trump, who responded, "Animals that must be hit hard!"
Protesters gathered outside the emergency room at the hospital where the injured deputies were being treated.
"To the protesters blocking the entrance & exit of the HOSPITAL EMERGENCY ROOM yelling 'We hope they die' referring to 2 LA Sheriff's ambushed today in #Compton: DO NOT BLOCK EMERGENCY ENTRIES & EXITS TO THE HOSPITAL," the sheriff's department tweeted.
"People's lives are at stake when ambulances can't get through."A radio reporter who was near the protest scene was taken into custody, KABC-TV reported. It wasn't immediately clear why she was detained.
Capt. Kent Wegener said officers were blanketing the area in search of a suspect seen on the video opening fire with a pistol.
"We have a very, very generic description," he said.
The incident happened around 7pm a short distance from the Compton sheriff's station.
- AP