It happened along the 2200 block of Emerald Street in the city's Kensington section just after 11 p.m. on Sunday.
Police say the 16-year-old suspect and another person approached a man on the street, flashed a fake gun and attempted to rob him.
The 21-year-old victim had a real gun and fired at the teen, wounding him in the leg.
The shooting was caught on surveillance video obtained by Action News.
"Just to clarify, the victim ran up to a vehicle that was parked and the operator of that vehicle is licensed to carry," an officer said in scanner traffic Sunday night when Philadelphia police responded.
The teen was taken to St. Christopher's Hospital for Children, where he is in stable condition.
Police recovered a fake gun and a 9 mm pistol at the scene.
"We heard gunshots, bang, bang, bang," a neighbor who did not want to be identified told 6abc. "We looked out and saw somebody running and a guy running. It's unusual on this block."
According to 6abc's Data Journalism Team, over the last year, 27 self-defense shootings have occurred in Philadelphia.
That's down from 37 seen in the previous year and 49 the previous year.
RELATED: Check the 6abc Neighborhood Safety Tracker