A 20-year-old New Jersey man accused of threatening on social media to "shoot everybody" at a pro-Israel march and bomb the Trump Tower skyscraper in New York City was arrested on Wednesday on a string of federal charges, prosecutors said.

Jonathan Xie, of Basking Ridge, was taken into custody on charges of attempting to provide material support to Hamas, the Islamist group that rules the Gaza Strip and which the United States designates as a terrorist organization, making false statements and transmitting threats over interstate commerce, according to federal prosecutors.

"Homegrown violent extremists like Xie are a serious threat to national security," U.S. Attorney Craig Carpenito said in a statement. "The actions that he took and planned to take made that threat both clear and present."

According to the charging documents, Xie appeared in an Instagram Live video in April 2019 wearing a black ski mask and displayed a handgun as he expressed the desire to attack demonstrators at a pro-Israel rally.

"I want to shoot the pro-Israel demonstrators ... you can get a gun and shoot your way through or use a vehicle and ram people ... all you need is a gun or vehicle to go on a rampage....I do not care if security forces come after me, they will have to put a bullet in my head to stop me," Xie said in the video, according to the court papers.

That same month Xie was spotted outside of Trump Tower, headquarters of the businesses owned by U.S. President Donald Trump. He later posted photos of the building on Instagram along with a poll asking if he should bomb it.

"Okay, so I went to NYC today and passed by Trump Tower and then I started laughing hysterically ... I forgot to visit the Israeli embassy in NYC ... I want to bomb this place along with trump tower," Xie said in a separate post detailed in the court documents.

In February 2019 Xie said he wanted to join the U.S. Army in hopes of learning "how to kill" and applied for a security clearance as a first step, prosecutors say.

He is also accused of sending money to an individual in the Gaza Strip aligned with a faction of Hamas that has carried out attacks against civilian targets in Israel.

It was not immediately clear if Xie, who faces more than 30 years in federal prison if convicted on all charges, had retained an attorney.