Officers shot and killed a pit bull over the weekend to rescue a man being attacked by the dog, Santa Rosa police officials said.

The 23-year-old man was attacked at about 11:20 p.m. Saturday in the backyard of a Navajo Street home off West Steele Lane during a party, Sgt. John Cregan said.

Before the attack, a neighbor called police to report a fight had broken out on the front lawn with a group of seven to 10 people, Cregan said.

When officers showed up, people standing on the front lawn fled, some into the house. Among them was the 23-year-old man, who apparently ran through the home and into the backyard where he encountered the dog, Cregan said.

Police heard him screaming.

The dog apparently wrestled the man to the ground and was viciously biting his leg when officers got to the backyard.

They tried calling the dog off, but the animal didn't budge, Cregan said. An officer fired one shot at the dog, which ran away and died from its injuries.

The man, who was not identified, suffered extensive injuries, with bites that cut him to the bone, and he was taken to a hospital, Cregan said.

A Sonoma County Animal Control officer collected the dog. Cregan said it will be tested for rabies.