A prosecutor in central Pennsylvania says a state trooper was justified in shooting to death a man who fired several shots and held police at bay outside a county jail earlier this month.

Adams County District Attorney Shawn Wagner announced that conclusion Wednesday after looking into the deadly shooting of 32-year-old Jess Leipold on April 9.

Wagner says Sgt. Matt Nickey reasonably believed he needed to shoot Leipold to prevent others from being hurt or killed.

The investigation found Nickey shot Leipold after Leipold aimed his rifle toward the front of the Adams County Prison outside Gettysburg.

Wagner says Leipold had no criminal record.

Leipold had been staying at a nearby homeless shelter for about three weeks before the shooting. Wagner says residents there described him as paranoid.