A Kentucky sheriff says a claustrophobic deputy has lost his job after accidentally locking himself in a jail cell and trying to shoot his way out of it.

Adair County Sheriff Ralph Curry tells WKYT-TV that no one was hurt when Charles Wright fired his weapon.

It happened Monday, the first day a new $12.4 million county judicial center was open to the public after more than a year of construction.

Curry says the former deputy has claustrophobia and has agreed to pay for the damage he did to the cell.