ORLANDO, Fla. -

A Bangladeshi man in the United States on a student visa was arrested Wednesday, charged with plotting a bomb attack on the Federal Reserve in New York City, and he used Facebook to communicate about and plan the attack.

Mashable reports that Quazi Mohammad Rezwanul Ahsan Nafis, 21, communicated on Facebook while planning his attack with undercover FBI agents posing as jihadists with connections to al-Qaeda.

His plot was foiled when he attempted to detonate what he believed was a 1,000-pound bomb in a vehicle parked near his target, but the explosive device was a fake provided by the undercover agents.

According to Mashable, court documents show that some of the early communications between Nafis and FBI agents over Facebook included discussions on Islamic law and conducting jihad in a country while there on a visa.