A man who tried to rob two people with a real looking BB gun in the Wynnefield section of West Philadelphia was wounded early Tuesday when his second victim shot him with a licensed weapon.

The man was shot three times in the stomach and chest area and is in stable condition after undergoing surgery at Penn Presbyterian Medical Center, Lt. John Walker of Southwest Detectives said.

Police were still trying to determine the man's identity; he did not have ID on him and has not been cooperating with police.

Walker said the man had a BB gun on him, which looked like the real thing.

It was about 5 a.m. when the man first tried to rob a 52-year-old man at a Gulf gas station on the 2200 block of Bryn Mawr Avenue. The victim had gone into the convenience store at the gas station to get coffee and had left his truck unlocked, Walker said.

When the victim returned to his truck, the robber was in the passenger seat of the truck and pointed the BB gun at the victim and ordered him to drive, Walker said. But the victim ran back inside the store, to safety, he said.

The robber got out of the truck and then accosted a second victim on the same block. He pointed his BB gun at a 27-year-old man who was heading home to his apartment after work and announced a stickup, Walker said.

The 27-year-old man had a license to carry and shot the man three times, injuring him, Walker said. This victim called 911 afterward and told police what he did, Walker said.

Walker said the shooting appeared justified.

After the would-be robber's identity is determined, he is expected to be charged with the two attempted robberies, Walker said.