An off-duty FBI agent accidentally shot a bystander in the leg when his gun fell from its holster as he cavorted on the dance-floor of a bar in Denver, Colorado, police said.
Video widely shared on Twitter shows the agent strutting his stuff and then performing a backflip.
The gun falls to the floor and, as the agent goes to grab it, fires a shot.
The fellow customer hit by the bullet was taken to hospital with a non-life-threatening injury.
It is unclear if the agent, who has not been named, will face charges or disciplinary action.
This @FBI agent was dancing at a Denver bar on Saturday night. Did a back flip, gun falls. He picks it up and a round is fired, hitting a man (he’ll be ok.) @DenverPolice investigating. #9News pic.twitter.com/MwV1WpNzAQ— Ryan Haarer (@RyanHaarer) June 3, 2018
The video shows that his wild moves on the dance-floor had attracted an appreciative crowd at the Mile High Spirits and Distillery bar on Saturday night.
But the mood quickly changed when the gun went off. As shocked patrons look on, the agent retrieves his weapon, holds up his hands and leaves the floor.
Denver Police Department said the agent "was dancing at a nightclub when his firearm became dislodged from its waistband holster and fell on to the floor. When the agent retrieved his handgun an unintended discharge occurred".
The statement, which did not name the agent, added: "The victim was transported to the hospital with a good prognosis."
Police are asking witnesses to come forward to help investigators, who are waiting on lab test results to determine "if alcohol was a factor".
Police spokeswoman Marika Putnam said the agent was taken to a police station and later released to an FBI supervisor.
The Denver District Attorney's office said the incident remained under investigation by the Denver Police Homicide Unit.
The District Attorney will determine if the agent should be charged with a criminal offence.