Armed with a sword, Hector Hechavarria walked into the Presidente Supermarket in Miami’s Little Havana neighborhood, threatened to kill shoppers, knicked a customer in the elbow, assaulted a security guard — and eventually was shot by the same guard, CBS-Miami is reporting.

The guard, according to the station, was Antonio Mendoza, 47. Police said his actions were heroic.