A suspect who was seen driving a vehicle used during the drive-by shooting of a San Bernardino sheriff's deputy is in custody, authorities said.
The deputy was preparing to serve an eviction notice when he was shot Tuesday morning. He is listed in good condition.
The shooting occured after two deputies were ambushed as they sat outside an apartment complex by someone who fired into one of the sheriff's cruiser's from another car.
Only one of the deputies was struck.
The man taken into custody was spotted by a San Bernardino police sergeant later in the day, authorities said.
San Bernardino Police Lt. Paul Williams said the suspect was seen exiting a vehicle and throwing items over a wall before officers were able to detain him.
A closer examination of the man's gray four-door car showed it had been hit by several rounds of gunfire. Two deputies returned fire when they were shot at, authorities said.
The vehicle was stopped at 21st Street and Elmwood Road, about a quarter mile southeast of the shooting scene.
The suspect was handed over to San Bernardino County Sheriff's detectives, who are handling the investigation.
Investigators did not know whether the shooting was connected in any way to the eviction notice, they said.