The Erie County District Attorney's Office in New York State says a man walked into a Dollar General in West Seneca, New York around 2:30 p.m. Tuesday and asked for an application.
For reasons unknown to police, the suspect, Travis Green, 29, became irate and left the store.
He then fired 20 rounds with an AR-15 rifle at the store from the parking lot, according to investigators. He was wearing body armor and camouflage.
One of the bullets hit a 53-year-old man in the shoulder. The victim was taken to the hospital and is now at home recovering with his family.
Officers say they managed to tackle the suspect a short distance from the store as he tried to run away. Police say no shots were fired in the process.
Green is charged with attempted murder, assault, criminal use of a firearm, reckless endangerment, unlawful use of body armor and a misdemeanor count of resisting arrest.
Police found 850 live rounds of ammunition in his vehicle.
Cheektowaga Police Chief David Zack credits "civilian heroes" with jumping into a chaotic situation and saving lives.
"I can also now confirm we did have a couple civilian heroes yesterday who played a crucial role in stopping the attack and assisting in the apprehension," said Zack. "I hope to meet with these brave citizens later today and thank them for their actions. There's no questions these individuals saved lives yesterday. They are heroes."
Green's next court appearance is scheduled for Nov. 20 in the Town of Cheektowaga Court.
At this point, investigators believe Green was acting alone and no other suspects are being sought. They say his motive remains a mystery.
The FBI and ATF are also assisting in the investigation. Cheektowaga Police say there is no indication that the shooting was terror related.