Police say there are no outstanding suspects.
Authorities say around 10:15 a.m., deputies with the court services division showed up at an apartment complex at 1455 E. Date St., presumably to serve an eviction notice.
According to San Bernardino Police Lt. Paul Williams, the deputies were in their vehicle when someone in another vehicle opened fire. Bullet holes -- one through the front windshield and two through the driver's side window -- could be seen in a sheriff's vehicle at the scene.
The deputies got out and returned fire. Within moments, police from all over the place were on scene. One of those units spotted the suspect vehicle.
"Several minutes later, a San Bernardino PD sergeant found the vehicle not far away from this location, and this vehicle had several bullet holes in it, and one person was detained at that point," said Cpl. Randy Naquin with the San Bernardino County Sheriff's Department.
The deputy who was shot was taken to an area hospital. Officials say he is expected to be OK.
"He's in stable condition. He's got several wounds to the left side of this head, his left hand and his left arm. He's expected to make a full recovery at this point," said Naquin.
Hunt Elementary School was placed on lockdown as a precaution. Streets in the area were closed due to the investigation.