A dancing FBI agent who accidentally fired his gun, striking a man in the leg after doing a backflip at a Denver bar in June will avoid jail time after pleading guilty Friday to third-degree assault.

Chase Bishop, 30, struck a plea deal with prosecutors and was sentenced to two years of probation, the Denver Post reported. He also must pay more than $1,600 in fines and court costs.

Footage of the shooting on June 2 at Mile High Spirits and Distillery went viral. The video showed Bishop dancing in the middle of a circle before doing a backflip. During the backflip, a gun fell onto the ground and discharged as Bishop went to pick it up. After the shot, Bishop was seen putting it in his waistband holster and walked away while holding his hands up.

CLICK HERE TO GET THE FOX NEWS APP

"My whole goal in life is to care, protect and serve people," Bishop said in court Friday. "I never expected the result of my actions to lead to something like this."

He pleaded not guilty in November to second-degree assault, which carries a penalty of up to 16 years in prison. Bishop will serve his probation in Georgia. He was in Denver at the time of the incident for FBI business and was off-duty at the time of the shooting. FBI spokeswoman Kelsey Pietranton declined to say if he would continue to work at the agency.

Tom Reddington, 24, the man who was shot, spoke in court saying he lost his job at an Amazon warehouse following the shooting and may never be able to run again.

"I have done months of physical therapy," Reddington said. "I have sought counseling. However, being in public, especially seeing law enforcement with guns, makes me very uncomfortable."

DANCING FBI AGENT WANTS TO MEET MAN HE ALLEGEDLY SHOT, ATTORNEY SAYS

However, he added that he does not hold a personal grudge against Bishop and didn’t think he deserved to spend years in jail.

“I’ve done stupid things at bars to impress girls, too,” Reddington said.

He said he hoped Bishop didn’t “carry a gun for a long time.”

The Associated Press contributed to this report.