An off-duty FBI agent accidentally fired his gun, striking another patron in the leg, at a Denver nightclub while he was dancing early Saturday, police said.

The unidentified FBI agent was at the Mile High Spirits Distillery and Tasting Bar around 12:45 a.m. Saturday when he broke out into a dance routine. A woman named Julie recorded the incident that showed the man dancing and doing a back flip. His gun then fell out of his waistband holster and on the floor.

“When the agent retrieved his handgun an unintended discharge occurred, another patron was struck by a bullet in the lower leg,” Denver police said in a statement to KDVR.

The agent was then seen placing the gun back into holster before walking off the dancefloor.

"Everyone was kind of shocked after it happened because [the agent] kind of put his gun back away and then he walked away," Julie told KDVR. "No one really knew what was going on.”

Julie said she was shocked by the incident and wanted to make sure her friends were OK at the moment.

SHIRTLESS, KNIFE-WIELDING MAN WITH SNAKE FATALLY SHOT BY POLICE AT STRIP MALL

Denver police spokesman Sonny Jackson said a man was shot in the leg when the gun accidentally discharged. The shooting victim was taken to the hospital in good condition.

Police investigators interviewed the agent before releasing the agent to an FBI supervisor. The police investigation was continuing, and any charges would be determined by the Denver District Attorney's Office, said Officer Marika Putnam.

The Associated Press contributed to this report.