HYANNIS (CBS) – An armed robber stormed a convenience store on Cape Cod and fired off a shot while demanding money. The clerk thought the robbery was a Halloween prank until the gunman fired.

It happened at the Willow Tree Market in Hyannis Saturday night. The robber showed the pistol, but when the clerk didn’t move fast enough, he fired a shot. The clerk then opened the cash drawer.

READ MORE: Nor'easter To Bring Up to 2 Feet Of Snow And Possibly Blizzard Conditions Saturday

“I got scared when I heard the shot,” said clerk Ali Afzal. “Who wouldn’t? So that’s when I just gave him the money.”

Surveillance video shows armed robbery firing gun at Hyannis store (WBZ-TV)

Surveillance video shows armed robbery firing gun at Hyannis store (WBZ-TV)

READ MORE: 2 People Rescued From Burning Tyngsboro Home

The clerk says he recognized the robber as a man named Cody, who police also knew. Officers spotted the suspect walking on Main Street the next day.

“One guy had three warrants for his arrest, they picked him up put him in the car, patted the other two guys down looking for the gun and it was on one of the juveniles, another friend that was not involved in the actual armed robbery but was carrying the gun,” said Barnstable Police Sgt. Sean Sweeney.

Police arrested 19-year-old Cody Martin, along with an alleged accomplice, 19-year-old Lamar Pringle and the juvenile who was with them and allegedly had the gun.

MORE NEWS: Patriots Celebrate 22nd Anniversary Of Hiring Bill Belichick, 20th Anniversary Of Winning AFC Championship In Pittsburgh

Police say Martin fired the gun just two feet in back of the clerk.