An Uber driver from Brooklyn was busted for plotting a Nice-like attack on Times Square and trying to join ISIS at least five times, feds charged Monday.

Mohamed Rafik Naji, 37, traveled to Turkey and Yemen between March and September of last year in an effort to join the terror group — and soon became obsessed with waging a “violent jihad” after returning to the US, prosecutors said.

In the days after the deadly July 14 truck-and-guns attack in France, Naji was caught on wiretaps discussing carrying out a similar strike in Times Square, the Brooklyn federal court complaint says.

“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,” he allegedly told a confidential source on July 19.

“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,” he added.

Eighty-six people were killed in Nice after a truck plowed into a crowd. ISIS had claimed responsibility for the deadly attack, which also left the assailant dead.

Naji made several trips overseas to join ISIS but had problems gaining access to areas it controlled in Yemen.

“It’s very hard to get in I’m on my 5 try its difficult mad po po military and ppl here very scared,” he allegedly emailed his girlfriend in the US.

The girlfriend regularly wired cash to Naji to fund his terrorist endeavors, while he urged her to erase all of his messages, court papers say.

“Hunny 1 last favor $2 grand for plane ticket and to get back I promise I’ll pay u back when I get there,” he wrote her on April 4, 2015. “It’s hard then [sic] I thought m [sic] tired hiding n mountains for 3 weeks it’s very very hard wallah,” he added using the Arabic expression for “I promise by God.”

Naji allegedly sent the girlfriend video files of his “first day on the job” on April 21, 2015 — around the same time when ISIS was known to be fighting in Yemen — in which gunshots and male voices can be heard.

Since 2014, Naji pledged his support for ISIS on Facebook, updating his profile picture to depict two men armed with guns and walking toward an ISIS flag and posting videos of ISIS fighters in combat, feds say.

Naji was arrested early Monday morning and charged with attempted to provide material support to a foreign terrorist organization.

His lawyer said he’s an Uber driver and has three children overseas.

Naji was held without bail following a brief court appearance.

“We don’t know if he actively said those things or if they were fed to him by a confidential source,” attorney Susan Kellman said in court. “He had a legitimate purpose for being in Yemen, he has family and children there.”