An off-duty FBI agent who was entertaining a crowd with his dance moves at a nightclub in Denver accidentally shot another clubgoer when his handgun tumbled from his waistband and discharged into the crowd as he attempted to pick it up.

According to Denver police, the victim was hit in the lower leg and was immediately rushed to hospital where medical staff have announced he should be OK.

USA Today reports: It happened around 12:35 a.m. at Mile High Spirits, a cavernous distillery and tasting bar that makes bourbon whiskey, tequila and gin and also hosts live bands and “DJ-fueled weekend dance parties,” according to its website.

The FBI agent, who hasn’t been identified, was questioned at Denver Police headquarters before being released to an FBI supervisor, according to KUSA-TV in Denver. Denver Police’s homicide unit is handling the investigation, and charges will be determined by the Denver District Attorney’s Office, it said.

Video of the incident showed the agent, dressed in khaki pants and a dark shirt, showing off dance moves as a crowd formed a circle around him. He ended his dance display with a backflip, and the video shows the gun tumble out of his waistband holster. As the agent retrieved the firearm, it is seen firing into the crowd at floor-level. The agent then walks off the dance floor.

It’s unclear whether the FBI agent had been drinking and authorities are awaiting results of blood tests to determine whether alcohol was a factor, according to CBS Denver. They are also reviewing videotape of the incident.

The federal Law Enforcement Officers Safety Act, enacted in 2004, allows qualified current law enforcement officers and qualified retired law enforcement officers to carry a concealed firearm in any jurisdiction in the United States, regardless of state or local laws, with certain exceptions, according to the National Rifle Association.

Though uncommon, there have been past instances where a federal agent’s gun has discharged in public places. In August, an agent with Immigration and Customs Enforcement on vacation accidentally shot himself while going through a security line at Orlando International Airport. The agent was hit in the left foot when his service weapon became dislodged from its holster.