(CNN) Authorities have arrested a 19-year-old man who they say texted undercover agents that he planned to conduct a terror attack in the name of ISIS in Queens, a law enforcement official said Thursday.

The 19-year-old is a Queens resident who was born in Pakistan, the official said. Authorities allege he was inspired by ISIS and planned to conduct a stabbing or bombing attack in Queens.

According to the official, the man was under constant surveillance by law enforcement authorities and did not pose a danger to the public.

"An individual was arrested in New York today as part of a national security investigation. Further information will be released when appropriate. There is no current public safety issue as a result of the arrest," a Justice Department spokesman told CNN.

The suspect is expected to appear in court in Brooklyn federal court on Friday.