FBI agents on Thursday arrested a 19-year-old New York City man who had been texting an undercover federal agent about his alleged plans to carry out an attack in the name of the terror group ISIS, according to multiple senior law enforcement officials.

The suspect, who lives in the borough of Queens, is expected to face charges of material support of terrorism on Friday.

In text messages with the undercover agent, the suspect allegedly claimed he wanted to perpetrate a knife attack in Queens. He also posted in an online chatroom about plans to commit an attack, according to a senior law enforcement official briefed on the investigation.

The suspect, who has not yet been publicly identified, allegedly ordered a knife via the undercover agent. When he went to pick up the knife, he was arrested by law enforcement, the senior law enforcement official said.

FBI agents and the FBI-led Joint Terrorism Task Force had apparently been onto the man since the beginning of his alleged plot.

In a statement, a spokesperson for the office of the United States attorney for the Eastern District of New York confirmed an "individual was arrested in a national security investigation today."

The suspect posed no public safety threat, according to the federal officials who confirmed the arrest and the U.S. attorney's office.

The charges against the suspect are expected to be unsealed on Friday morning.