A California deputy with the El Dorado County Sheriff's Office was gunned down and an off-duty deputy with another department was injured when they were shot at while responding to a theft Wednesday morning.

El Dorado County Deputy Brian Ishmael, a 4-year veteran, was shot and killed. A San Joaquin County Sheriff's Deputy who was not on-duty and riding along with Ishmael was injured. He underwent surgery at a local hospital and has since been released, El Dorado Sheriff John D'Agostini said at a news conference.

Deputy Brian Ishmael was killed in the line of duty in El Dorado County, Calif. El Dorado County Sheriff's Office

Deputies were called to an area of Sand Ridge Road and Mt. Aukum Road in Somerset, about 53 miles east of Sacramento, for a "call for service." D'Agostini said it was in response to a theft at a marijuana garden at a private residence.

When the two deputies arrived, they were immediately fired upon. The San Joaquin County deputy returned fire, the sheriff said.

The injured deputy has not been identified. The San Joaquin office said in a news release that he is 28 years old and has been with the department for a little over two years.

Two men have been taken into custody. D'Agostini said one of the suspects was shot and hospitalized in an unknown condition. D'Agostini said there may be other suspects.

Before joining the El Dorado County Sheriff's Office, Ishmael was with the nearby Placerville Police Department.

"We are proud to have had Brian work with us at the Placerville PD. He will be missed," the department tweeted. "Our prayers go out to our L.E. brothers and sisters at EDSO, and Deputy Ishmael's family and friends. God Speed Brian."

D'Agostini described Ishmael as "personable" and "always positive." He was married with three children.

"He never had a bad day. He was a loving father and husband," the sheriff said.