A man under investigation by the New York FBI Joint Terrorism Task Force because he allegedly discussed wanting to set off an explosive device in the city’s iconic Times Square was arrested early Friday, law enforcement sources said.

There is no threat to Times Square and the suspect, Alam Ashiqul, 22, has been under surveillance for some time and was closely monitored by authorities, three law enforcement sources said. He was arrested for allegedly trying to buy guns with removed serial numbers.

Ashiqul, who lives with his parents, is a Bangladeshi citizen and a legal permanent resident of the United States with a green card, official documents say.

An undercover plan helped track Ashiqul, of Queens, who was scheduled to appear in court at the Eastern District of New York later Friday. Undercover officials first met who Ashiqul in August 2018, and continued meeting with him until this week. According to court documents, Ashiqul "repeatedly spoke approvingly about various terrorist attacks, including the September 11th terrorist attacks." Law enforcement said Ashiqul admired various terrorist organizations, including the Islamic State group.

Ashiqul allegedly took surveillance video of Times Square and spoke of wanting to attack people there. Sources tell NBC News he also allegedly spoke of wanting to attack politicians in New York and Washington, D.C., and spoke of an interest in explosives, a suicide bomb vest, and hand grenades. Court documents say Ashiqul also discussed obtaining AR-15 assault rifles to use to kill law enforcement officers.

Officials described Ashiqul as a lone actor, adding that they took the threat seriously.

Ashiqul was denied bond Friday after a judge declared him a danger to the community and a flight risk.

Spokespeople for the New York Police Department, the FBI, and the U.S. Attorney’s Office all declined to comment.

In 2010, Pakistani immigrant Faisal Shahzad attempted to detonate a bomb in Times Square, which did not go off.

He was arrested two days later when a bomb in the back of a sport utility vehicle fizzled with a mere sputter of smoke, drawing the attention of a street vendor who alerted police, the Associated Press reported when he was sentenced later that year.

Shahzad was sentenced to life in prison.