A Modesto, California, police officer found himself squaring off this week against a hostile mob of about 60 — among them several known gang members — with only his dog on his side.

Authorities believe the crowd had gathered for a party, police spokesman Sgt. Brian Findlen told The Modesto Bee.

The policeman, whose name wasn't released, was in the area responding to another call when he saw several people assaulting a man, according to the newspaper.

When the officer went to break up the fight, the crowd’s attention switched from the party to him.

In an attempt to keep the mob at bay — and perhaps to prove the old "man's best friend" adage — the policeman sent his dog into the throng of people.

The animal latched onto one suspect who was apprehended and later identified as 18-year-old Alfredo Espinoza, the Bee reported.

But Espinoza had the crowd on his side. When the officer approached him for an arrest, they pulled the teen away and allegedly challenged the cop to a fight.

One suspect reportedly lunged at the officer during the struggle; his two-way radio broke during the scuffle. He yelled for neighbors to call 911, using his gun to hold off the mob, the paper said.

Another in the crowd threatened that he "wouldn't be leaving the scene alive."

In addition to Espinoza, the Bee reported, authorities arrested Andrew Mitchell, 20; Matthew Reyes, 19; William Rodriguez, 29; and Junior Suarez, 19; on charges ranging from resisting and delaying a police officer and false imprisonment of an officer to forcibly removing a suspect from police custody and assaulting a police dog.

The policeman and his dog escaped virtually unscathed. They suffered only minor injuries, Findlen told the paper.

Click here for more on this story from The Modesto Bee.