The incident was reported just after 3 p.m. in the 13000 block of East Avenue R-2 in Littlerock.
According to the Los Angeles County Sheriff's Department, San Bernardino sheriff's detectives were conducting a search warrant near Avenue R and 130th Street East when the detective was shot.
The detective was sent to a nearby hospital for treatment and is listed in stable condition.
The suspect died at the scene.
The incident remains under investigation. Anyone with information is being asked to contact the L.A. County Sheriff's Department's Homicide Bureau at 323-890-5500.