FRESNO, Calif. -- Police in Fresno, California, have released dramatic surveillance footage showing a customer stepping in to prevent an armed robbery at a Starbucks.

Authorities said the video shows a hero taking down a man who will soon face many felony charges, CBS affiliate KGPE-TV in Fresno reports.

Cregg Jerri, 58, was enjoying his Starbucks order and working on his iPad at 5:30 p.m. on Thursday when a man holding a yellow bag and wearing an Optimus Prime Transformers mask entered the store. The suspect demanded money and began threatening the clerk with a fake gun and a buck knife.

Get Breaking News Delivered to Your Inbox

Police said Jerri came swooping in, hitting the suspect with a chair from behind in an attempt to stop the robbery. A fight ensued, and Jerri was stabbed in the neck during the struggle, but he wrestled the knife away from the suspect, who eventually fled the scene.

Footage shows Cregg Jerri stop an armed robbery attempt at a Starbucks in Fresno, Calif. KGPE-TV

Police later arrested the suspect and identified him as 30-year-old Ryan Michael Flores.

"There's probably not very many people in America who would do what Cregg Jerri did last night," Fresno Police Chief Jerry Dyer told reporters. "It was incredibly heroic and the way most people would think that they would respond but may not have the courage to respond."

Both Jerri and the suspect were sent to the hospital with injuries. Jerri needed six staples in his neck to mend the stab wound, but police said he is expected to make a full recovery.

Meanwhile, Flores is in critical, but stable condition. Police said he will be sent to jail as soon as he recovers.