He was apparently on the verge of losing his home and had intended to rob the store.
According to the San Francisco Chronicle, suspect Tony Paul Bennett knew Alamo jewelry mart owner Oscar Herrera.
Prosecutors say Bennett armed himself with three guns last Thursday night and then entered the store at the Alamo Square shopping center.
Police say Bennett told Herrera he was losing his house. Something went wrong, and Bennett opened fired on Herrera. But Herrera managed to make it to the back of the store, grab his own handgun and return fire.
Both men are in the hospital and are expected to survive.