The incident occurred at 8 p.m. as the officer attempted to pull over a suspected drunk driver in an area near the city of Poway, the Sheriff’s Department said.
The officer heard four shots and saw a muzzle flash and immediately notified the Sheriff’s Department for backup, said Sheriff’s Sgt. Chad Boudreau.
Arrested on suspicion of attempted murder were Michael Rains, 28, of Ramona, and the driver, Daniel Schwartzel, 18, who told authorities that he is a transient. Both were booked into jail in downtown San Diego.
A gun was found in the car and shell casings in the nearby roadway, the Sheriff’s Department said.
Neither the suspects nor the officer was injured. The officer’s name was not released.