Police spokeswoman Luba Samri said a 16-year-old Palestinian entered the supermarket in Mishor Adumim, east of Jerusalem, and stabbed two Israeli shoppers. Samri said the two shoppers, in their 50s, were moderately wounded and taken to a hospital in Jerusalem.
The security guard shot the attacker in the legs and police later arrested him, Samri said.
The stabbing attack continues Israel's worst-sustained bout of violence in nearly a decade.
Over the past month, 11 people have been killed in Palestinian attacks, including five people who were killed with guns and meat cleavers in a bloody assault on a Jerusalem synagogue.