The incident took place just before 6:00 p.m. at the Koh Kong Grocery store in the 2200 block of South 7th Street.
Police say a masked gunman entered the store and announced a robbery.
That's when a customer stepped in and tried to struggle the gun away.
"During the struggle, the robber fired two shots, struck our victim two times, in the head and in the leg," Philadelphia Police Chief Inspector Scott Small said.
The victim, identified by family members as 46-year-old Jesse Tanner, was rushed to Thomas Jefferson University Hospital.
He is in guarded but stable condition.
Police say the robber, who ended up not stealing anything, was wearing a royal blue hooded sweatshirt. He fled on foot north on 7th Street.
Police say they were working on securing surveillance footage of the suspect and a possible lookout.
Meantime, relatives of the good Samaritan who tried to stop the armed robbery say they are not surprised by his actions.
"He's a very generous guy, he's a very friendly guy," relative Charles Mbth said.
"A lot of people around the neighborhood know him; he's always doing good deeds for everybody," relative Sophath Khmeth said.
Police don't recommend that people try to thwart an armed robbery because of the dangers; they say the Good Samaritan is very lucky in this case.