A small army of cops descended on a building in the Flatiron District this afternoon and took a crazed gunman into custody after he threatened construction workers, police sources said.

The suspect, Kenneth Clarfield, 69, turned out to be a “hoarder” who has rarely left his apartment over the past 30 years, according to one police source.

When he has ventured outside, Clarfield usually wears a colorful bandanna and sits on a fire hydrant on his block, said neighborhood resident Daryl Glenn, 45.

“I’ve seen him in the neigborhood for 20 years. It is a little odd that he sits there, Glenn said, adding, “My friend was in the building on his floor. He’s pretty shaken up.”

The bizarre incident began at 12:45 p.m. as the two hardhats were on a scaffold doing window work on the eleventh floor of an apartment building at 12 East 22nd Street, sources said.

Moments later, Clarfield opened a window in his apartment, pointed a gun at the workers and snarled, “Get away, get away,” sources aid.

The workers quickly got down and called cops, who asked Clarfield to open the door, but he refused, sources said.

Emergency service cops and hostage negotiators were called in and began talking to the perp.

Finally, at about 3:35 p.m., Clarfield surrendered without incident and was taken into custody.

Police were awaiting a warrant to search the apartment for the gun. There were no reported injuries.

Residents and business owners in the neighborhood were kept on edge for several hours as officers barricaded the roads and posted snipers on nearby rooftops.

“The police blocked the street and locked us in the store at around 1:30,” said one witness, Sunny Yoo, 30, a stylist at Polaris salon, located next door. “They let us out again at 3:40. Of course we were scared. He looked crazy.”