Police said 38-year-old Yuriy Alterman was taken into custody near Sixth Avenue and 49th Street -- right outside of Fox News Channel in Midtown.
An employee at the TV network called police because the man was apparently acting strangely and carrying a gas can.
When officers approached Alterman, they said he told them, 'f--- the police." Police confiscated the gas can, found he had matches on him and was carrying the book, "Son of Hamas."
Alterman told the officers that he didn't intend to set anything on fire. He was just walking around the city.
The officers found no terror connection, but charged him with making terroristic threats. He was scheduled to be arraigned in Lower Manhattan Tuesday.