SOMERSET, Calif. -- A Northern California sheriff's deputy was killed Wednesday while responding to a call regarding a theft from a private marijuana garden in the rural Sierra Nevada foothills, officials said.The El Dorado County Sheriff's Office said Deputy Brian Ishmael was fatally shot in the community of Somerset and that a ride-along passenger with him, an off-duty deputy from the San Joaquin County Sheriff's Office, was also shot and injured.The off-duty deputy returned fire and tried to save Ishmael, Sheriff John D'Agostini said at a news conference. An officer with the California Highway Patrol took the off-duty deputy to a hospital, where he underwent surgery and has since been released. He is expected to survive.Two men were detained and a large contingent of law enforcement officers and a helicopter remained at the scene about 45 miles (72 kilometers) east of Sacramento, said a statement from the sheriff's office. D'Agostini said one of the men was shot and taken to the hospital in unknown condition.The sheriff said they don't know if any other people were involved.A procession of law enforcement vehicles accompanied Ishmael's body Wednesday morning to the Sacramento County coroner's office."We lost one of our heroes," D'Agostini said.The deputy was a four-year veteran of the El Dorado County Sheriff's Office and previously worked for the Placerville Police Department for two years. He is survived by a wife and three children."Brian worked in this community and lived in this community," D'Agostini said. "He was personable, easy to talk to, kind and always positive. He never had a bad day."Deputy Andrea Lopez from the San Joaquin County Sheriff's Office said their deputy, a 28-year-old who has been with the department for more than two years, was not doing the ride-along for any San Joaquin County purposes. She said authorities believe he had a friend in the El Dorado County Sheriff's Office."We don't know why he was there," she said. "We would love to see our deputy recover as quickly as we can."Law enforcement often use ride-alongs for community outreach and engagement purposes. In Los Angeles, websites for the city's police department and county sheriff's office both state they accept ride-alongs from community members. Agencies typically require civilians to sign a waiver and complete a background check.Tab Rhodes, president of the Los Angeles County Professional Peace Officers Association, said ride-alongs allow people "to get an understanding of what an average day in law enforcement looks like."It's often also used as a recruitment tool or a prerequisite for potential hires "to give a realistic perspective to something that is often glamorized on TV and movies," he said.Governor Gavin Newsom released this statement in response to Deputy Ishmael's death: