A police officer who accidentally pulled and fired his gun rather than a stun gun to subdue a jail inmate will not be charged.

>> Read more trending news

The officer, who retired Wednesday, was not identified.

Bucks County District Attorney Matthew Weintraub called the March shooting an accident.

"After careful consideration, I have determined that (the) shooting... was neither justified, nor criminal, but was excused," Weintraub wrote in a letter to New Hope Police Chief Michael Cummings.

Brian Riling, 38, was shot in the stomach during an altercation with officers in a holding cell March 3. As the officer struggled with Riling, he yelled “Taser” as a warning, then mistakenly shot him with his service weapon.

Riling can be heard saying toward the end of the video, "I don't want to die, dude."

Riling was taken to a hospital in critical condition and has since been released. He was in police custody after being arrested on charges of intimidation, burglary and retaliation against a victim.

His attorney did not comment.

The Associated Press contributed to this report.