The shots rang out just before 11:30 p.m. Tuesday near Fifth and West Rockland streets in Olney.
A customer leaving a take-out restaurant was punched in the face by a would-be robber.
Assault victim pulls out a gun & shoots alleged attacker in Olney. He's licensed to carry/stayed on scene. The suspect is in stable @6abc— Annie McCormick (@6abcAnnie) January 11, 2017
"The complainant drops his food and runs," said Philadelphia Police Lt. John Stanford. "And as he's running, he's screaming for help, actually trying to avoid any confrontation."
But the 18-year-old suspect chased him across the street, and the 31-year-old victim fought back.
"The complainant is actually armed, and he has a valid permit to carry," said Stanford. "At some point he pulls out that firearm. And he fired several shots, striking the male."
The suspect was hit once in the leg.
Police say the victim waited for police to arrive and told them his side of the story.
"The complainant returns to the scene when police arrive and identifies himself and shows he has a permit to carry," said Stanford. "So at this point in time it appears this is a situation of self-defense."
Officers rushed the suspect to the hospital, where he remains in stable condition. He is expected to be charged with attempted robbery.
Police say two people were with the suspect at the time of the attempted robbery, but they are cooperating with police and will not be charged.
The victim suffered minor injuries from being punched in the face.
Police say it is up to the district attorney's office, but they do not expect charges to be filed against the victim, who defended himself.
Business owners tell Action News there have been problems with young people targeting residents out and about in the evening in this largely immigrant community.
"This happens at least twice a week. All these muggings and robberies. We're used to it. We just have to cope with it," store owner David Hincapie said.