The customer, who didn't want to be identified, told ABC11 that he put his hands in the air after hearing a gun cock.
That's when he turned around and saw the gunman wearing a hoodie with a bandanna around his face.
He said a manager came over and told the would-be robber to let the customer and a clerk behind the register leave the store.
"The robber didn't want to do it," the customer told ABC11. "He said, 'No, we're going to take their phones, their wallets. And he (manager) yelled at him. He said, 'Nope they have nothing to do with you. They're going to walk out right now.' And the robber said, 'OK.' And so we walked out."
Once in the parking lot, the customer called 911.
He said he was on the phone with the dispatcher when more people came running out of the store.
One of them was the manager who chased the robber into a nearby apartment complex.
You can hear him in the background of the 911 call made by the customer.
LISTEN: Hear the dramatic 911 call
"I got his gun with prints on it," the man screams out.
The customer could hardly believe his eyes and ears.
"He had already stripped the gun and the bag from the robber, was chasing him around the corner, saw the robber take off in the apartment complex," the man said.
The customer said Cary Police arrived quickly.
They soon had the suspect, 24-year old Christopher Purnell, of Durham, in handcuffs.
He has been charged with attempted armed robbery.
They have also arrested 25-year old Anthony Burton of Durham for allegedly conspiring with Purnell and aiding in the crime.
It was just a week ago that a CVS store in neighboring Morrisville was robbed.
Morrisville police sent out a surveillance picture from that crime.
Cary police said they are comparing notes with other area police departments about other similar crimes.
Meanwhile the customer and eyewitness from the Cary crime said he's learned the manager at the CVS is a young father who only recently started working there.
He said he had also learned the man is a former military police officer.
"I was impressed by the manager," the customer said. "He was in control the whole time. He was telling the robber what to do."