A New York City taxi driver was charged Monday with trying to join ISIS and expressing support for a Nice-style attack in Times Square.

The criminal complaint unsealed in federal court provides no indication that Mohamed Rafik Naji, a citizen of Yemen and legal resident of Brooklyn who drives for Uber, was actually planning an assault.

Naji, 37, began posting pro-ISIS content on Facebook in 2014 and in the spring of 2015 traveled to Yemen and Turkey in an effort to join the terrorist group, the criminal complaint alleges.

"We can't get in," he wrote in an email message to his girlfriend, then asked her to send him $2,000 for a plane ticket back home.

"It's harder than I thought," he wrote to her, saying he was tired of hiding in the mountains for three weeks.

He also sent her a selfie in which he wore all-black clothing, a tactical vest and a bandanna over his face, with a large knife handle visible, the court papers say. In a video he sent, titled "First day on the job," gunshots can be heard, the papers say.

In court, defense attorney Susan Kellman said her client had a "legitimate purpose" for being in Yemen. "He has family there," she said.

Naji returned to the U.S. in September 2015 and continued to communicate with a paid government informant who had made contact with him through Facebook, the complaint says.

In a recorded phone conversation with the informant in July, he spoke about the deadly Bastille Day attack in Nice, France, in which a gunman used a truck to run over revelers, killing 86 and injuring hundreds more.

"I was saying if there is a truck, I mean a garbage truck and one drives it there to Times Square and crushes them shshshshshsh...Times Square day," Naji is quoted as saying.

"They want an operation in Times Square," he went on. "The Islamic State already put up scenes of Times Square, you understand."

Related: ISIS Singles out Thanksgiving Parade as 'Excellent Target'

The complaint notes that jihadi propagandists exhort their followers to use vehicles as weapons. An article in ISIS' English-language magazine this month urged supporters in the West to use rented trucks in Nice-style attacks and called the Macy's Thanksgiving Parade "an excellent target."

Police plan to station sand-filled trucks and concrete barriers as blockades all around the parade route to stop trucks, authorities told NBC News. although they say they've heard of no credible, specific threat to the parade.