Pak-American allegedly planned attacks in New York City on behalf of IS (Representational image)

A Pakistani-American teen allegedly planned deadly attacks in New York City on behalf of the Islamic State (ISIS) terrorist organisation and wanted to inspire others to launch similar offensives, US officials said.

Assistant Attorney General for National Security John C. Demers said on Friday that Awais Chudhary, 19, "allegedly planned to conduct a deadly attack in New York on behalf of ISIS".

Mr Chudhary was produced in a federal court on Friday and charged with attempting to provide material support to the ISIS and Magistrate Judge James Orenstein ordered him held without bail.

Mr Chudhury wanted to "record the bloodshed in the hope of inspiring others to commit attacks", federal prosecutor Richard Donoghue said.

He was detained on Thursday when he went to an online vendor's retail outlet to pick up gear he had ordered to record his planned attacks.

City Police Commissioner James O'Neill said, "Awais Chudhary had accepted the call from IS to kill fellow New Yorkers."

Before he was arrested by the New York Police's Joint Terrorism Task Force and the Federal Bureau of Investigation (FBI), "(Awais) Chudhary had carefully planned, conducted reconnaissance, picked a target, and was in the process of obtaining the weapon and 'all he has left to do was to strike'," Mr O'Neill said.

According to court documents, Mr Chudhary was unmasked by undercover law enforcement personnel with whom he communicated his plans using text messages to conduct stabbing or bombing attacks on behalf of the ISIS and suggested targets including the World's Fair Marina.

He also had picked several pedestrian overpasses on a major road from where he wanted to throw bombs, the complaint said.

He also sent an undercover agent a screenshot of an ISIS terror manual on places to strike and the "ideal knife" use, with instructions on how to stab a victim, court papers said.

There have been several instances of people of Pakistani or Bangladeshi descent or with ties to Pakistan targeting the city on behalf of Islamic terrorist groups or attempting to join them.

In 2010, Pakistani-American Faisal Shahzad, who was trained in Pakistan planted a car bomb in Times Square on behalf of the Pakistan Taliban, but it failed to completely explode when it was discovered.

Last week, Asia Siddiqui, who was identified in one media report as being of Pakistani descent, admitted in a federal court to participating in a terrorist plot, which an official described as an attempt at "waging violent jihad" using bombs.

In the latest case, a Bangladeshi-American, Delowar Mohammad Hussein, was arrested last month while trying to go to Pakistan to join the Taliban. He was the fourth person on Bangladeshi descent arrested in the city on terrorism charges.

Ashiqul Alam, who is of Bangladeshi descent was arrested in June in connection with a plot to shoot up Times Square.

In addition, two persons of Afghan descent with ties to Pakistan have been involved in terrorist activities.

In 2016, Ahmad Khan Rahimi set off a bomb in the city injuring 31 people and another one he had planted was discovered before it exploded and removed by a police robot.

Najibullah Zaz was found guilty of an al-Qaeda plot to carry our suicide bombing in the city's metro in 2009.