A 17-year-old was fatally shot by Los Angeles County sheriff’s deputies in Palmdale early Thursday as he tried to stop his dog from attacking the officers, according to an internal sheriff’s department memo.

The 17-year-old was struck in the chest as he tried to jump on the dog, said the memo, a copy of which was reviewed by The Los Angeles Times. A deputy who had been bitten by the animal was also struck by a bullet fragment in the shooting.

In a news conference at the scene hours after the shooting, Capt. Christopher Bergner of the Sheriff’s Department Homicide Bureau said it appeared that both the teen and the deputy had been struck by ricochets when deputies fired at the charging animal, which deputies identified as a pit bull.

Authorities said deputies had gone to the home around 3:40 a.m. in response to a call about a loud party. As they arrived, a dog charged at them and bit one of the deputies in the left knee, Bergner said.

The owner tied up the dog after that incident. But while the deputies were still at the scene, the dog got loose and charged the deputies again.

The deputy who was bitten was also struck by the bullet fragment. He was treated at a local hospital and is reportedly in stable condition.

The dog was shot but survived.

Read Related Article on Shooting at Dogs