In 2017, 24 officers were injured in the line of duty and two died from gunshots wounds, including a Whittier Police Department officer and a Sacramento County Sheriff’s deputy, according to state data.