According to authorities, the suspect got out of the car and began fighting with Ahmed and then shot him in the face.
"The shot deputy went down to the sidewalk," Sheriff Lee Baca said. "The training officer ultimately was facing the suspect and struggling with him. That same suspect that shot the first deputy put the gun to the second deputy's chest. The deputy slapped the gun away from his chest."
That's when the deputy fired at least two shots, fatally wounding the suspect.
Officials said the suspect, whose named was not immediately known, had two guns in his possession.
Ahmed was transported to Los Angeles County USC Medical Center, where family members, fellow deputies and Baca gathered to be with the critically injured deputy.
Officials said the bullet was lodged in the right side of his face.