NEW YORK - A Brooklyn man was charged Monday with supporting the Islamic State terror group and allegedly plotting an attack in Times Square.

Prosecutors say 37-year-old Mohamed Rafik Naji told a confidential informant about plans to use a garbage truck to plow through a crowd.

They say he was inspired by the attack over the summer in Nice, France that left more than 80 people dead.

The FBI says Naji has been posting social media messages supporting the Islamic State group since 2014, and he traveled to Yemen and Turkey last year in efforts to join them. 

"He has family in Yemen. I don't think it's illegal to visit your family if you're overseas. And he's not charged with visiting his family overseas," said defense attorney Susan Kellman. "I'm just saying, he had a legitimate purpose to be there."

Naji's attorney says he has a wife and three children in Yemen.

He did not enter a plea at his initial court appearance Monday in Brooklyn federal court and was ordered held without bail.