A Richmond police officer shot one of the department's K-9 officers on Tuesday morning after the dog bit him, authorities said.

Sgt. Nicole Abetkov said the act was in self-defense.

She said the dog, a 3-year-old Belgian Malinois, bit the officer just before 7 a.m. in the parking lot of the Richmond Police Department. The K-9’s handler left his car with the dog still in it to go inside the station for a meeting, police said. The dog somehow got out of the car and bit another police officer in civilian clothes.

The officer who was attacked, a four-year veteran of the department, fired his handgun once, according to police.

The officer was taken to the hospital after suffering unknown injures. The dog suffered critical injuries and was taken to a PETS Referral Center in Berkeley, Abetkov said. The dog has since been transferred to a UC Davis veterinary hospital and is now in a stable condition, authorities said.

It was not immediately clear what prompted the dog to bite the officer. Authorities said the dog had never had a problem before.

Police investigators said they plan to scrutinize the system of extra locks and remote controls packed into each K-9 patrol cars.

“Everything will be checked out with a fine-toothed comb,” Abetkov said.

Richmond police has a 54-year history of using police dogs – more than half of that time with the Belgian Malinois breed. The dogs were initially recruited to search Richmond’s numerous warehouses. Officers use them now mostly for tracking felony suspects and searching for evidence and narcotics.

NBC Bay Area's Chuck Coppola contributed to this report.