An off-duty law enforcement officer shot a man who was attacking a woman with a knife at Union Station on Saturday night. (WUSA9)

A man who was attacking a woman with a knife was shot at Union Station on Saturday night by an off-duty law enforcement officer. The knife-wielding man had refused to drop the weapon before being hit, along with a bystander, according to police sources.

The incident, in which shots were fired and heard only blocks from the Capitol, in one of the region’s major public facilities, appeared to arouse concern about possible terrorism. Police were quick to assert that no terrorism was involved.

The attacker was struck in a hand and in his head, according to two police sources who spoke on the condition of anonymity. His condition was not immediately known. Capt. Mark Beach of the First police district said the man received preliminary treatment at the scene, and then was taken to a hospital where he was undergoing surgery around midnight.

The bystander, a woman, was hit in the ankle, and released from a hospital after treatment, Beach said in a statement. Metro spokesman Dan Stessel said she may have been struck by a ricocheting bullet.

Parts of the station and its surroundings were shut down, and a large number of officers swarmed the area in a response that suggested heightened alertness in the aftermath of the terrorist incidents in Paris.

“First and foremost,” Beach said in his statement, the incident was “ NOT AN ACT OF TERRORISM” nor was it in any way related to the Paris killings.

The need to allay fears was suggested by Beach’s use of all capital letters to assert in his written statement that terrorism was not involved.

The incident occurred about 8:15 p.m. as the attacker was headed up an escalator from the Metro station toward the Amtrak facility at Union Station, according to accounts from Stessel and the police sources.

According to Beach, the stabbing observed by the off duty officer “was not a random act.” Instead, Beach said, the stabbing victim and her assailant “knew each other and were related.”

He said she received a facial wound and, like the bystander, was taken to a hospital where she was treated and released. Reportedly she had left the scene before calling authorities

After witnessing the stabbing, Beach said, the off-duty officer confronted the man with the knife. He was shot “to neutralize the threat,” Beach said in his statement.

It was not immediately clear what sort of knife was involved or whether it had been located.

Beach’said the off-duty officer was employed by a law enforcement agency in Maryland

The police sources said he was a member of the Baltimore County police.

Police said the incident remained under investigation. They asked any witnesses to call them.