MASONTOWN, Penn. – Cops neutralized a gunman at a Pennsylvania courthouse Wednesday afternoon. The unidentified shooter was killed by a police officer after opening fire at the office and injuring several people, officials said.

Among those wounded in the shooting incident at District Magistrate Daniel Shimshock’s office in Masontown, Fayette County was “a law enforcement official,” Pennsylvania State Police Troop B confirmed on Twitter.

The gunman was scheduled for a hearing on assault charges he received weeks ago, according to authorities.

The armed man entered the lobby shortly after 2 p.m. and began shooting with a handgun, said Lt. Steven Dowlin, station commander of the Pennsylvania Police Department’s Troop B, which handles Fayette County, ABC News reported.

Police officers from the Masontown Borough Police Department and German Township Police Department then entered the lobby, and Masontown Police Sgt. R. Scott Miller was shot after he engaged the gunman, Dowlin said.

After Miller took cover, the gunman continued into the building and shot two males and one female, said Fayette County District Attorney Rich Bower. At the time, several people were in the courtroom, including Fayette County Magisterial District Judge Daniel Shimshock, his staff, an assistant district attorney, several defense attorneys and multiple police officers, Bower said. But, the gunman never made it inside the room.

A German township police officer then shot the gunman multiple times, killing him, Dowlin said. He was pronounced dead at the scene but was not identified pending next of kin.

Sgt. Miller was receiving treatment for hand injuries at a hospital in nearby Uniontown.

The wounded civilians were brought to a West Virginia hospital, whose spokesman said they were listed in fair condition.

After hearing about the shooting, County Commissioner Vince Vicites arrived at the building and learned that the coroner was called to the scene because the shooter had died, he told The Associated Press.

“At this time we have multiple victims and injuries one being a law enforcement official. There is heavy police presence,” state police tweeted. “We are asking the public to stay away from the area at this time.”

The location is secure and there were no lockdown orders for nearby schools, businesses or offices, police said.

Authorities asked that anyone with information contact the State Police-Uniontown at 724-439-7111.

Fayette County officials in a tweet said they were “deeply saddened” by the incident in Masontown.

“Fayette County officials will continue assisting state and local police by any means necessary,” the tweet said. “Our thoughts are with the victims and their families.”

Masontown, Pennsylvania is located roughly 60 miles south of Pittsburgh.