A federal law enforcement officer Wednesday night shot at but missed a man suspected of stealing a motor scooter at gunpoint in Northeast Washington, D.C. police said.

But after taking the suspect into custody, officers realized that they had the wrong man, police said. Officers had mistaken the man’s scooter for one that had been reported stolen a few minutes earlier, police said.

Officer Araz Alali, a D.C. police spokesman, said that shortly before 10 p.m. officers went to the unit block of Anacostia Avenue NE, just off East Capitol Street, to investigate an armed robbery in which a motor scooter was taken. The officers broadcast a description.

A short time later, police said members of a gun task force, which includes an agent from the federal Bureau of Alcohol, Tobacco, Firearms and Explosives, saw a man on a scooter at a gas station in the 3800 block of Minnesota Avenue NE.

Alali said the man ran when police approached and hid under a house. When officers peered under the building, the ATF agent saw the man with “a dark object” in his hand and fired once, Alali said.

When police took the man — who was not wounded — into custody, they found that he did not have a gun, Alali said. But Alali was not able to describe the object that had been seen in the man’s hand.

While investigating, the officers determined that the motor scooter was not the one taken in the robbery, Alali said. No arrests have been made in that case.

Police did arrest the man who was shot at. Jamal Thomas, 20, of Northeast was charged with assault on a police officer and driving without a license.