Police detained a man who barricaded himself inside an apartment building with a gun in the Flatiron District Wednesday afternoon, after the man reportedly threatened workers on scaffolding outside his window, the NYPD said.

Police at the scene said the situation began around 2 p.m., when the NYPD responded to calls of a man brandishing the weapon inside his apartment near 22nd Street and Broadway.

The man, reportedly in his 70s, then barricaded himself inside. After about an hour and a half of negotiating, the unidentified man surrendered to cops around 3:30 p.m. without incident and was taken into custody, police said. Cops on the scene wouldn't confirm whether he had a gun, and said they were waiting on a search warrant.

It was unclear whether the man, who was not immediately identified, would be charged.

Get the latest news and more great videos at NewsdayTV Credit: Newsday

Too many rainy weekends? ... LI Works: Making Countertops ... LEGO at Old Westbury Gardens ... Previewing the Knicks in the NBA Finals ... Get the latest news and more great videos at NewsdayTV

Get the latest news and more great videos at NewsdayTV Credit: Newsday

Too many rainy weekends? ... LI Works: Making Countertops ... LEGO at Old Westbury Gardens ... Previewing the Knicks in the NBA Finals ... Get the latest news and more great videos at NewsdayTV

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME