Fresno police are crediting a man’s courageous actions to thwart a would-be robber inside a Fresno Starbucks, but warn actions like these are not always going to have a good outcome.

Newly released surveillance video from inside the Starbucks shows a customer taking on the armed suspect that entered the café just after 5:30 p.m. July 19, KFSN reports.

Investigators say the suspect, identified as Ryan Flores, walked into the Starbucks armed with a knife and toy gun, demanding money from the register.

That’s when the customer, later identified as Craig Jerri, saw what was happening, grabbed a metal chair and hit Flores over the back with it.

The two began fighting and Jerri was able to get Flores to the ground. Jerri, however, was stabbed in the neck, but he is expected to recover, police told KSFN.

“It’s not something we recommend. In this case, it was a good outcome,” said Fresno Police Chief Jerry Dyer. “No one died as a result of this incident, but he very well could have. But nonetheless, he’s a hero – there’s no question.”

Police told KFSN Jerri managed to wrestle the knife away from Flores and actually stab the suspect several times before he got away.

Police later tracked down Flores, where he admitted to the crime and was treated for his injuries before being taken into custody.