Police shot and killed an armed man Monday night in the Germantown area after responding to a report that two people had been shot, authorities said.

After many gunshots were heard in the area of Great Seneca Highway, Montgomery County police encountered a man armed with what was described only as “a long gun.”

The man was ordered to put down the weapon, said Capt. Jim Daly, a police spokesman, but he refused to comply. Police fatally shot the man about 9:45 p.m. near Great Seneca Highway and Grotto Lane.

He was not identified immediately. It appeared late Monday night that nobody else had been shot.

The man was killed after a 30-minute incident that Daly described as a “dangerous situation for the community” and “a dangerous situation for the officers.” It was “obviously tense for everyone,” he said.

The incident began about 9:15 p.m., when police received a call from a man saying he had shot two people at a house on Red Robin Terrace. As police arrived, Daly said, shots rang out. Officers sent for reinforcements, and more shots were heard.

After determining that the man had left the house, police came upon the man with the gun. A specific description of the weapon was not immediately available.

Police “gave him several commands to surrender, which he refused to do,” Daly said.

People at the townhouse from which the original call apparently came were found unharmed, Daly said. It was not clear whether any relationship existed between them and the gunman. No police officers were injured.

It was not known how many officers fired at the suspect.

A helicopter circled overhead during the search for the gunman, and one or more dogs also were used.