Four suspected robbers were arrested on Friday after one accidentally shot himself in the leg during a stick-up at a motel, according to authorities.

Surveillance video at the Quality Inn in Aiken, South Carolina, shows 27-year-old David Dempsey point a gun at the front desk clerk and demand money.

After the clerk hands over nearly $300, Dempsey turns to flee and accidentally shoots himself in the leg.

According to authorities, the bumbling bandit retreated to the getaway car with his three accomplices. They flagged down sheriff's deputies when the officers responded to the crime scene.

Dempsey received treatment at a local hospital and was released to join his co-conspirators in the county jail. The group is accused of a string of robberies.

WRDW News 12 reported:

“All of a sudden,” victim Pat Coats recalled, “he goes ‘Give me all your money,’ so I started pulling out bills and everything.”

Coats explained that he “didn’t want to get shot” and complied with the armed robber’s demands. As he was leaving with almost $300 from the Quality Inn’s till, however, the crime took a fateful turn.

“On the way out I hear a pop,” Coats said, “and the gun had gone off, and that tells me that’s real.”

The sound was followed by the robber’s scream, he said, noting he witnessed the armed man limp out of the hotel into a waiting getaway vehicle.

“Karma got him by that gun going off,” Coats said.

Watch more above.