San Bernardino County Sheriff's spokeswoman Lori Miller said two deputies were in their cruisers about to serve the notice when an unknown number of suspects in a nearby vehicle opened fire. One of the deputies was struck by gunfire.
The officers returned fire but the suspects fled, the Los Angeles Times said.
The suspects' vehicle was found abandoned a short distance away. One suspect was taken into custody later in the day after a San Bernardino police sergeant saw him getting out of a vehicle and throwing unspecified items over a wall, the Times reported.
A search of the vehicle showed it had been struck by gunfire.
Investigators said they were unsure whether the suspects were in any way related to the eviction notice.
A nearby elementary school was placed on lockdown following the shooting.