It happened around 7:38 p.m. when the 39-year-old delivery driver was dropping off food on the 3300 block of H Street in the city's Kensington section.
"I was just remodeling my kitchen and talking to my son, and he was about to come out the door, and as soon as he went to open the door- that's when we heard the shots," neighbor Eric Howard told Action News.
Police say the delivery driver was approached by a 23-year-old man who pointed a gun at the male victim and demanded he get out of the car.
"The driver of that car- when he saw that this male was pointing a gun at him, demanding that he get out of the vehicle - brandished his own firearm, which he was legally allowed to carry," said Philadelphia Police Inspector DF Pace.
The victim, who police say has a license to carry, grabbed his own gun and shot the suspect six times.
"Th guy was licensed to carry a gun and defended himself," Howard said.
According to Inspector Pace, the suspect was able to return fire, but the victim was not injured.
The suspect was taken to an area hospital by a private vehicle where he was placed in extremely critical condition.
Police say two people who were with the suspect are also being questioned at this time.
Philadelphia police have ramped up patrols in recent weeks to tackle a spike in carjackings.
There have been more than 90 carjackings so far in the city this year. Last year, there were more than 750 incidents.
Anyone with any information in connection with Thursday night's incident is asked to call police at 215-686-TIPS.