A jail guard was shot and killed at a Pennsylvania courthouse by what appears to be friendly fire during a struggle with an inmate who had grabbed her weapon, and authorities said Thursday they were investigating how it happened.

The inmate had been taken from the Blair County jail to Central Court in Altoona for a hearing Wednesday when he disarmed corrections officer Rhonda Jean Russell, state police said.

Authorities said a law enforcement officer in the building opened fire on the inmate to stop him from harming Russell, who was struck by the bullet.

Russell, 47, of Altoona, was pronounced dead at UPMC Altoona, according to state police.

State police did not identify the officer who opened fire, but Altoona Police Sgt. Matt Plummer said an Altoona police officer was involved.

State police said the inmate was being charged with criminal homicide, attempted criminal homicide, kidnapping and related charges.

State police and the Blair County prosecutor's office are investigating.

Copyright 2021 AP. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.