A Bronx deli clerk wrestled a gun away from a would-be robber in a harrowing attack caught on video.

The New York Police Department says a man placed a food order on Monday before going behind the counter, displaying the gun and demanding cash.

When the clerk hesitated, the man struck him on the head several times with the gun.

Surveillance video shows the gun pointed at the clerk's head as the two grapple.

Police say the suspect fled when the worker got the gun away from him.

The clerk was treated for pain and bruising to his face and head.