(Reuters) - A man chased his estranged wife into a crowded Pennsylvania court building where they were due to appear for a domestic violence hearing on Wednesday, then shot and wounded her before he was fatally shot by police, according to law enforcement and local media.

Three others, including a police officer, were wounded in the incident that began with an argument between the man and woman outside the court building in Masontown, a small borough south of Pittsburgh, local TV station WPXI reported.

The woman fled into the building and he chased after her, shooting with a handgun and wounding at least two people outside, WPXI said.

They burst into the court building, where 30 to 40 cases, most of them preliminary hearings, were on the docket for the afternoon session, Fayette County District Attorney Richard Bower said at a news conference.

Bower declined to confirm the relationship between the man and woman, saying the next of kin had not been notified, but told reporters the man was due in court on strangulation and assault charges related to domestic violence and had a restraining order against him.

WPXI said the woman was shot in her arm in the court building as several police officers rushed to intervene, shooting multiple times at the gunman, killing him.

Linda Endsley, who saw the shooting, told the station that her son used his belt as a tourniquet to staunch bleeding from the woman’s arm as she hid under a desk.

“She was very calm, we were more upset than she was,” Endsley told the news channel. The woman became more upset when she learned her estranged husband had been killed, Endsley said.

The wounded victims, including the police officer, were taken to local hospitals, said Craig Konopa, a spokesman for the Fayette County Emergency Management Agency.

The gunman was declared dead at the hospital, Konopa said.

The police officer was shot in the hand, WPXI reported. The judge, Daniel Shimshock, was not among the injured, Konopa said.

One glass door into the municipal building was left shattered, video from the scene showed.

The names of the gunman and the victims have not been released to the public, Konopa said.