SAN DIEGO (CBSLA.com) — A San Diego police detective shot and killed a pit bull in the backyard of a San Diego home during a probation check Wednesday.

KNX1070’s Tom Reopelle reports the owner agreed to move her dogs from a back room but somehow a pit bull got loose and attacked the detective and an FBI agent in the backyard.

READ MORE: OC Receives More Than 83K COVID-19 Vaccine Doses In Single Day

San Diego Police Lieutenant Kevin Mayer said the dog first charged and bit the officer.

“The detective’s pants were getting shredded, his legs were getting bit,” he said.

READ MORE: LA County Sheriff's Motorcycle Deputy Thomas Albanese Killed In Lakewood Crash

“The FBI agent withdrew a baton and began striking the dog, trying to get it to back off. During the process, the FBI agent gets his hand bit.”

Mayer said the officer withdrew his firearm during the attack and fired three rounds at the animal, which died at the scene.

MORE NEWS: Lady Gaga's Dogwalker Shot, Wounded In Hollywood; 2 French Bulldogs Stolen

The FBI agent and police detective were taken to the hospital with minor injuries.