Dance like the whole world is watching.

An off-duty FBI agent whose gun accidentally fired after it dropped out of its holster while he was doing a backflip at a Denver nightclub was taken into custody on Tuesday, jail records showed.

Chase Bishop, 29, turned himself in to the Denver County Sheriff's Department Tuesday morning and was being held in a detention center in downtown Denver. He was charged Tuesday with one count of second-degree assault, the Denver County District Attorney's Office said.

Denver police have said Bishop was dancing at a nightclub in the early hours of June 2 when the gun fell from his waistband holster and hit the floor.

When he went to grab it, the gun went off and wounded a man. He was taken to a hospital, where he was listed in good condition.

And the whole thing was captured on cellphone video.

The FBI field office in Denver declined to comment on the incident "to preserve the integrity of the ongoing investigation," said Amy Sanders, a spokeswoman.

Sanders said the field office would fully cooperate with Denver police and prosecutors "as this matter proceeds through the judicial process."

Bishop is not assigned to the Denver office but works out of Washington, sources told NBC affiliate KUSA. He is scheduled to appear in court on Wednesday morning.