An attempted armed robbery at an ATM in Selma, Alabama ended when a good guy with a gun opened fire on the suspect.

AlabamaNews.net reports that a masked man with a gun walked up to a woman at a Wells Fargo ATM at around 10:00 p.m. Monday night and demanded money. Fortunately, the woman happened to be with her grandson, who — unbeknownst to the suspect — was armed with a gun of his own.

The grandson drew his firearm and the two men exchanged gunfire. The would-be robber was shot and fled the scene.

“We received a call from Prattville PD last night that this subject had been driven to Prattville by his mother and that he was going to the hospital over in Montgomery cause he had a bullet lodged in his back close to his spine,” said Lt. Sam Miller of the Selma Police Department. “As with any gunshot wound, its going to be reported to law enforcement.”