Ahmed Ferhani and Mohamed Mamdouh plead not guilty Wednesday to a "terror plot targeting New York synagogues."

The charges were files by the Manhattan district attorney who outlined Ferhani and Mamdouh's plot in a statement after the hearing.

"Between October 2010 and May 2011, Ferhani and Mamdouh conspired to bomb synagogues and churches in Manhattan to send a message of violence to non-Muslims, including Americans, Christians, and, primarily, Jews," the DA's statement read.

Ferhani and Mamdouh face six and five charges respectively of possessing weapons and terrorism. But the grand jury rejected a charge of conspiracy to commit a terror crime, which carries a maximum of life imprisonment.

That charge was replaced with lesser conspiracy charges which impose jail terms of between 12 and a half to 32 years.

Ferhani and Mamdouh's plan was to "dress up as Jewish worshippers, attend a service at a synagogue, and leave a bag containing a bomb inside the synagogue before departing," the statement said.

The indictment said the two would-be terrorists wanted "to blow up ten synagogues at one time" and also "use grenades to blow up churches."

"A picture emerges from today's indictment that describes how the defendants plotted to bomb synagogues in Manhattan in an effort to contribute to what they referred to as 'the cause,'" the statement said.

In May, when the plot was uncovered, police told the press two men of North African descent -- one a US citizen and the other a legal resident -- were arrested immediately after purchasing weapons from an undercover agent.

The pair bought two Browning semi-automatic pistols, a Smith and Wesson handgun, ammunition and a hand grenade during the sting operation.

According to the Manhattan prosecutor's office, the undercover investigation lasted seven months, during which time Ferhani and Mamdouh were recorded making plans for horrific attacks against the city's large Jewish population.

New York, targeted repeatedly by Islamist bombers in the last two decades, has been on heightened alert since US commandos killed Osama bin Laden in Pakistan.

Mayor Michael Bloomberg said in May that there had been 13 plots against New York since the September 11, 2001 terror attack that resulted in the mass murder of some 3,000 people at the World Trade Center.