The officer encountered the dog after police were called to a home on the 2300 block of Coronet Boulevard around 5:30 p.m. Thursday.
Several neighbors had called 911 to report the sounds of yelling and glass breaking coming from inside the house, according to Lt. Patrick Halleran.
Officers arriving at the home heard yelling and loud music, and detained a 30-year-old man who lived there.
During a search of the home for other occupants, the 6-year-old German shepherd, named Magnum, ran out of the house and charged at a police officer.
The officer fended off the first attack, but when the dog attacked again and bit him on the leg, the officer shot the dog once, Halleran said.
The dog, which also bit another adult occupant of the home during the incident, later died of his wounds.
The officer was treated for bite wounds at San Mateo County Medical Center and released. The occupant who was bitten declined medical treatment.
No one was arrested and the incident remains under investigation, Halleran said.