MIDDLETOWN, N.Y. (CBSNewYork) – Authorities say a gunman who was shot and killed after walking into a Middletown courthouse in Orange County Wednesday morning may have been targeting the mayor.

The incident took place around 9:09 a.m. shortly after the courthouse opened. Police said 43-year-old Timothy Mulqueen drove up on a Honda dirt bike carrying a shotgun inside a hunting sling.

1010 WINS’ Steve Sandberg reports

Officials say he then took out the gun, walked into the courthouse and opened fire after reaching a metal detector and security checkpoint inside the building before he was eventually killed by two court officers, who opened fire, according to the Orange County District Attorney.

One of the court officers was grazed by a bullet and taken to an area hospital.

“As soon as I heard the gunshots…I hit the floor, I heard everybody yelling,” witness Rameek Alston said.

Authorities believe Mulqueen entered the building looking for Middletown Mayor Joseph DeStefano, 1010 WINS’ Steve Sandberg reported.

“I don’t know what his intent was, and I guess we’ll never know what his intent was, but he had a lot of anger,” DeStefano said. “I’m just thankful that the court officers were there and able to protect all the people at City Hall and the city court.”

The two apparently had a long, contentious history dating back to 2000, when the mayor deemed Mulqueen a slumlord. He later lost his properties.  Turns out, Mulqueen had a court date Wednesday to appear on an order of protection regarding the DeStefano’s daughter.

Mulqueen had been charged with third-degree menacing stemming from an encounter with the mayor’s daughter at the DeStefano home, where he apparently showed up armed with a machete and a board embedded with nails last August.

LISTEN: WCBS 880’s Peter Haskell In Middletown

“I was concerned when her came to my home, absolutely, you know, concern your children and why somebody would come to your home,” DeStefano told WCBS 880 reporter Peter Haskell.

Witnesses inside the building described a chaotic scene.

“People tripping over each other. The ladies, the young people that were in there were screaming,” witness Travis Schadt told Haskell.

“He just started opening up in the courthouse and he was shot,” witness Bruce McCann told CBS 2’s Lou Young.

“I heard no talking from the suspect, it was all from the court officers,” said Schadt. “‘Get down, get down, stop’ and then they fired.”

WATCH: CBS 2’s Lou Young reports

“I never seen as many people running as I did,” said witness Eric Moranti. “Everybody was pushing and shoving to get out.”

“Thank God the court officer had weapons to defend everybody or there would have been a mass murder here today,” said witness Marty Memmelaar.

Mulqueen is believed to have been a lone gunman. Before his identity was revealed, authorities said the suspect was well-known to police.

Watch & Listen LIVE