A Queens man was arrested Thursday and accused of plotting a terrorist attack with a knife on behalf of the Islamic State, federal prosecutors announced Friday.

Awais Chudhary, 19, was arraigned in Brooklyn federal court on one count of attempting to provide material support to a designated foreign terrorist organization. U.S. Magistrate Judge James Orenstein ordered Chudhary held without bail.

Prosecutors say Chudhary communicated with undercover FBI agents in text messages, telling them he planned to carry out a stabbing or bombing to kill innocent people in the name of ISIS and wanted to record it to “inspire” others. Chudhary, a naturalized U.S. citizen born in Pakistan, allegedly identified two potential attack locations in Queens: the World’s Fair Marina and a pedestrian bridge over the Grand Central Parkway to the Flushing Bay Promenade

MARYLAND MAN ACCUSED OF PLOTTING ISIS-INSPIRED TERROR ATTACK NEAR DC IS INDICTED.

Chudhary allegedly ordered a tactical knife, a mask, gloves and a cellphone chest-and-head strap so he could record the attack. He was arrested while trying to pick up those items from an online vendor’s retail location.

“Awais Chudhary had accepted the call from ISIS to kill fellow New Yorkers in the city he called home,” NYPD Commissioner James O’Neill said in a statement. “He had carefully planned, conducted reconnaissance, picked a target, and was in the process of obtaining the weapon. All he has left to do was to strike.

"The FBI agents and NYPD detectives of the JTTF [Joint Terrorism Task Force] should be commended for the disruption of this plot. Their work almost certainly saved lives.”

TRIAL OF ALLEGED 9/11 MASTERMIND, FOUR OTHERS SET FOR EARLY 2021

Chudhary allegedly told one undercover agent he wanted to use a knife for the attack “because that’s what he knows," but would be open to learning how to build a bomb if the undercover agent could teach him. That done, he would consider using a bomb at a “mini-bridge over a busy road with many cars,” according to the Justice Department.

Chudhary allegedly sent another undercover agent the screenshot of a document titled “Islamic State” that allegedly instructed users where to stab someone and what knives were “ideal.” The document included diagrams with directions on where to stab someone's body, the DOJ said.

Chudhary also scoped out his locations, and FBI agents saw him take cellphone photos and videos at several locations.

CLICK HERE FOR THE FOX NEWS APP

“There’s no doubt Chudhary allegedly wanted to make headlines by attacking innocent people going about their daily lives,” said FBI Assistant Director-in-Charge William Sweeney. “Thanks to the diligent work of the agents, analysts and detectives on the FBI New York JTTF, the only thing to report today is his arrest, and the only photos Chudhary will be featured in are the ones taken in our prisoner processing room prior to his arrival in federal prison."

If convicted, Chudhary faces up to 20 years in prison.