It happened around 9 p.m. Wednesday at 58th Street and Baltimore Avenue in the city's Cobbs Creek section.
Police say officers on patrol heard gunshots coming from the area.
Arriving officers and medics found a 55-year-old male had been shot three times - once in the abdomen, once in the leg and once in the back.
Police say the victim was in his full security guard uniform and armed when he was approached by three males inside Andy's Beer.
One male was brandishing a gun, police say.
"When he saw these males with a gun, he pulled his own gun and fired at the males," said Philadelphia Police Inspector D.F. Pace. "A shootout ensued."
Police tell Action News the guard was wearing his bulletproof vest, which may have saved his life.
The guard was taken by medics to an area hospital and placed in stable condition.
As police were investigating the scene, they got word that a 17-year-old male who had also been injured in the shooting arrived at the hospital by a private vehicle.
He had been shot once in the arm.
"We are unsure of the relationship between the two individuals at this time," said Pace.
At least 40 spent shell casings were found at the scene and two cars in the parking lot were hit by bullets, according to Pace.
Action News was there as police cordoned off a large portion of the shopping center parking lot.
Police believe the security guard may have been off-duty when he was approached by the suspects.
"It does not appear that the security guard was working at this establishment. He may have been coming from work, he may have been going to work -- it's unclear at this time. However, we do know that he was licensed to carry," said Pace.
The motive for the shooting may be robbery.
Police say no arrests have been made.
Anyone with information is asked to call police at 215-686-TIPS.