A teenager was arrested by the FBI after allegedly telling an undercover agent he planned to carry out a violent knife terrorist attack in the name of Isis.

Awais Chudhary, of Queens, New York, exchanged messages with the FBI agent on an online chatroom and boasted about his wishes to purchase a 'tactical knife', according to reports.

The 19-year-old teenager allegedly attempted to buy a weapon through the undercover agent, New York Daily News reports.

A teenager was arrested by the FBI after allegedly telling an undercover agent he planned to carry out a violent knife terrorist attack in the name of Isis (stock photo)

But the FBI swooped in and arrested Chudhary when he went to pick up the knife from the SkyView shopping center in Queens.

NYPD officers and Homeland Security Investigations were also present to make the arrest.

Police say Chudhary planned to carry out the attack in the Flushing area of Queens.

Agents from the FBI were spotted investigating the teenager's house on Thursday, with a neighbor telling NBC New York she had only seen the suspect twice in two years.

The NYPD Counterterrorism Bureau tweeted Friday afternoon: 'In collaboration with our federal partners at the FBI New York Joint Terrorist Task Force (JTTF), we have intercepted and thwarted a planned terrorist attack in the Flushing area of Queen, #NYC.

'Adwais Chudhary was planning to carry out a “lone wolf” style knife attack targeting the residents of #NYC in the name of ISIS. This case moved rapidly from planning to execution. Chudhary’s target was the Flushing Bay Promenade near the World’s Fair Marina.

'On several occasions, Chudhary conducted pre-operational surveillance of the target location, surrounding areas and possible escape routes.

'Thanks to great work of the JTTF, made up of federal, state and local law enforcement agencies, we are glad to be reporting an arrest in this case instead of a successful attack.'

FBI swooped in and arrested Chudhary when he went to pick up the knife from the SkyView shopping center (pictured) in Queens

The 19-year-old is expected to face a judge on Friday on terror-related charges.

'An individual was arrested in a national security investigation today,' a spokesman for the Brooklyn U.S. Attorney's Office said.

'Further information will be released when appropriate. There is no current public safety issue as a result of the arrest'.