It was after midnight at the Mile High Spirits bar near downtown Denver, and things were going well for the man in the middle of the dance floor. Patrons surrounded him and women smiled at him, some recording him with their phones, as he showed off his freestyle dance moves.

Then, he swung his arms back and squatted, as if to prepare for his next big move. He jumped up, arching his back and swinging his arms above his head. But as he was about to land his back flip, a gun flew out from his holster at the back of his pants. He landed, and as he picked up his gun from the floor, it fired.

The man tucked his gun back into his holster and walked away from the dance floor, raising both his hands. Patrons began to scatter, and the women who had been smiling at him just seconds earlier stared, an open-mouthed look of shock on their faces.

The incident, which occurred at 12:45 a.m. Saturday, was captured in a 32-second video obtained by ABC affiliate KMGH.

The man was an off-duty FBI agent, according to the Denver Police Department, which did not identify him. He accidentally fired his gun as he was picking it up from the floor, striking another bar patron in the lower leg, police said. That patron was taken to a hospital and is in good condition.

Denver police spokesman Marika Putnam said she does not know what type of gun the agent was carrying.

The police department’s homicide unit is investigating the incident, and the Denver district attorney’s office will decide on criminal charges, if any.