An off-duty Federal Bureau of Investigation (FBI) agent on Saturday accidentally shot a man while dancing and doing a back-flip in front of a crowd in a Denver bar.

The agent’s stunt went horribly wrong as his gun went off after he dropped it while dancing and playing up to the crowd. The gun went off as he picked it up after dropping it during a back-flip attempt.

The agent, whose identity is not yet known, was filmed dancing enthusiastically while a group of people watched at the Mile High Spirits and Distillery bar.

The video then shows the agent retrieving the weapon and walking out of the cleared circle he had been dancing in with his hands held up. He however does not appear to walk in the direction of where the bullet was fired.

Police in the Colorado city said the gun had fallen from its waistband holster during the acrobatic incident, which happened in the early hours of Saturday. They also confirmed a man was injured and had been taken to a local hospital with a non-life-threatening injury.

Police spokeswoman, Marika Putnam said the agent was taken to a police station and later released to an FBI supervisor, even as the Denver district attorney’s office said the incident remained under investigation.