A 37-year-old Brooklyn resident has been arrested for allegedly trying to fight for the Islamic State of Iraq and Syria (ISIS) in Yemen, according to court documents filed Saturday.

Prosecutors say Mohamed Rafik Naji, a citizen of Yemen and legal permanent resident of the U.S., has been expressing support for ISIS on social media since September 2014.

He is alleged to have traveled to Turkey and Yemen between March 22, 2015 and September 9, 2015 in an effort to join ISIS fighting in Yemen.

Get Breaking News Delivered to Your Inbox

Naji, during his travels to Yemen, reportedly repeatedly expressed his admiration for ISIS on Facebook.

Mohamed Rafik Naji, a citizen of Yemen and legal permanent resident of the U.S., was arrested for allegedly trying to fight for ISIS in Yemen, according to court documents. Jane Rosenberg

Prosecutors allege he repeatedly tried to enter ISIS territory to join the group while in Yemen between March and September of 2015.

In an email to his girlfriend on March 25, 2016, about his trials trying to enter the terrorist group’s territory, Naji allegedly wrote: “It’s very hard to get in I’m on my 5 try its difficult mad po po military and ppl here very scared inshallah I make it m keep trying if not m have to go from somewhere else.”

Court docs indicate that just one month later, Naji sent a selfie to his girlfriend “in which he is wearing all black clothing, including a tactical vest in which a large knife handle is visible.” A short time later, Naji allegedly sent a video showing him taking gunfire. Prosecutors say Naji’s girlfriend allegedly sent him money several times in Yemen.

When he returned to New York City after failing to join ISIS abroad, Naji is alleged to have shared his plans for a local attack with a confidential informant similar to the attack in Nice, France for Times Square.

Speaking about a potential attack by ISIS in New York, Naji is alleged to have said: “They want an operation in Times-Square, reconnaissance group already put out a scene, the Islamic State already put up scenes of Times-Square, you understand. I said that was an indication for whoever is smart to know.”

Officials have long expressed fears about ISIS supporters who appear to be self-radicalized in the U.S. Arrests have been piling up since the rise of the terrorist group in 2014.