Patrick Shawn Dowdell, 61, faced felony charges in an August incident in which his wife said he wrapped a belt around her neck until she couldn't breathe.
Dowdell was scheduled to appear before District Judge Daniel Shimshock on Wednesday afternoon in Masontown when he began shooting a handgun at a woman outside the magistrate’s office.
Witnesses said the woman, whom authorities did not identify, fled into the East Church Avenue office as Dowdell shot at her.
"As soon as I looked down the hallway and seen that woman running and the glass shattering behind her with the bullets coming through the glass, I grabbed my mom's wrist and we went to the floor,” said Todd Endsley.
As dozens of people waiting for court scattered to seek cover, Dowdell entered the office and followed the woman down a hallway, still shooting. One witness said Dowdell entered the courtroom in the middle of a hearing and pointed his gun directly at one person or more before leaving, witnesses said.
"For me, the most terrifying thing was that the shooter came in, swept the room with the gun, pointed it at me and then just walked out," said attorney Eric Randolph.
However, state police Lt. Steve Dowlin said Dowdell stayed in the municipal building's main area and did not enter a courtroom.
Dowdell headed back toward the lobby, where he exchanged gunfire with responding police officers, including German Township Police Chief Dave Hromada.
"You could tell when police started firing," said Alan Brown, who was in the lobby. "There was a lot more gunfire at that point."
Dowdell left the lobby and encountered at least one more officer outside, who fired several shots at Dowdell, killing him. Officials have not identified that German Township police officer.
Masontown Sgt. R. Scott Miller suffered a gunshot wound, and two other men and a woman also were injured. Witnesses said the woman was Dowdell’s target, and she suffered a gunshot wound to her arm.
Endsley said he used his belt as a tourniquet for her injury.
"For that whole time, I sat there and held her arm up and was talking to her,” he said. “She needed help and I helped."
All the victims, including Miller, are expected to recover.
"It's unfortunate that someone lost their life, but I'm proud of my officers, and everyone did what they were trained to do," Hromada said at a news conference.
Nearby schools were placed on lockdown immediately following the shooting, but officials said the moves were precautionary and staff and children were never in danger.