Everything went according to plan for two barbershop robbers in West Philly last night.

Well, almost.

Police said the gun-toting thieves easily shook down a barber and his three customers inside the shop, at 55th and Poplar Streets, shortly after 4 p.m.

But the crooks stopped in their tracks when they found a badge in a wallet that belonged to one of their victims, an off-duty sheriff's deputy.

Investigators said the robbers took off on foot and started blasting away when the unidentified deputy chased them.

The deputy wasn't wounded and was able to return fire, striking their getaway car once near 48th Street and Wyalusing Avenue.

Shortly after, an unidentified man showed up at the Hospital of the University of Pennsylvania, nursing a gunshot wound to the leg.

Investigators said it was unclear if the wounded man was the robbers' getaway driver. The unidentified man claimed that he had been wounded at a separate shooting.

It was unclear exactly how much money the thieves took from the barbershop. Investigators said one of the victims claimed to have been robbed of $1,500 in cash.

Tipsters can contact Southwest Detectives at 215-686- 3183 or -3184. *