New York (CNN) -- A Manhattan grand jury indicted two men Wednesday on multiple terrorism charges in connection with a terror plot against New York synagogues.

The men were arrested in May, marking the end of a seven-month undercover operation by New York police officers.

The defendants, Ahmed Ferhani and Mohamed Mamdouh, are charged with multiple criminal counts of weapons possession, terrorism, conspiracy and a hate crime. If convicted, they could face life behind bars without the possibility of parole.

According to Joan Vollero, deputy director of communications for the Manhattan district attorney's office, both men pleaded not guilty.

Court documents allege that Ferhani and Mamdouh plotted to intimidate and kill non-Muslim Americans, Christians and especially Jews by conspiring to bomb several synagogues and churches in Manhattan.

Manhattan District Attorney Cyrus R. Vance Jr. said Wednesday's indictment specifically describes how the suspects conspired to use violence to support their cause.

"Their desire to commit violent jihad against Jewish Americans is not only an act of terrorism but also a hate crime," he said.

On May 11, Ferhani and Mamdouh were detained in midtown Manhattan after buying two loaded Browning semi-automatic pistols, one Smith & Wesson revolver, ammunition and a grenade, according to Police Commissioner Ray Kelly.

At least a dozen police officers swarmed Ferhani, who was placing the weapons in the trunk of his car. Mamdouh was arrested on a street nearby moments later.

Ferhani, a 26-year-old unemployed resident of Queens, is a native of Algeria who traveled to the United States in 1995, claiming asylum.

"Muslims are abused all over the world, and I ain't going to take it," prosecutors quoted Ferhani as saying; his conversations with an undercover police officer were secretly recorded.

Prosecutors say Ferhani sold narcotics in an effort to finance the planned attacks.

Ferhani's attorney, Elizabeth Fink, claims that the defendant has a serious psychiatric problem that the NYPD has known about for years. "You just have to look at the facts, and you'll see this guy is not guilty," she said.

She cites infighting between state and federal governments and the political ambitions of elected officials for a weak case against her client. "For some reason, these people want to exploit and drive a wedge between the people of New York," Fink said.

Mamdouh, 20, also a Queens resident, was previously arrested on a pending 2010 burglary charge. He worked for a local delivery service and came to the United States in 1999 with his family from Casablanca, Morocco.

Both men's voices were captured on audio recordings plotting the attacks, Vance said, but they had not selected which synagogue to target.

Neither man has been charged in connection with a terrorist cell. Both, however, were allegedly "committed to violent jihad," telling police that they wanted to kill Jewish people and also hoped to attack New York's Empire State Building, Vance said.

"While Osama bin Laden is dead, terrorism around the world is not," Mayor Michael Bloomberg said of the plot.

Such "lone wolves" are "the toughest to stop," the mayor said, noting that at least 12 terrorist plots in New York have been thwarted since September 11, 2001.

"We know that, as an international symbol of freedom and liberty, New York City is and will always be a target."

Authorities said the suspects discussed disguising themselves as Jewish temple-goers, growing beards and pretending to pray as a way to sneak inside a synagogue and place a bomb.

During the course of the police investigation, Ferhani was recorded discussing his goal of financing "the Palestinian cause in Gaza" and traveling to Gaza in an effort to kill Israeli soldiers, according to a district attorney statement.

The suspects offered no resistance during the arrest, and the plot appears to be more aspirational than operational, police said.

"Generally, the federal government has a greater interest in prosecuting these matters," said former federal prosecutor Michael Wildes. "Their deferral here begs the question of the posturing and the behind-the-scenes politics that played out."

Wildes called it a "major accomplishment" for the state to try a terrorist suspect, rather than to proceed under federal jurisdiction.

Over the course of the investigation, prosecutors say, Ferhani discussed buying multiple guns while trying to learn how to build a bomb.

He allegedly proposed blowing up an empty synagogue, as well as a church in Queens. Later, Ferhani was recorded discussing ideas of blowing up a synagogue "with Jews or Zionists inside," the statement said.

U.S. Homeland Security officials continue to stress that lone wolves and homegrown terrorists are high on their list of concerns and can be just as dangerous as those with direct ties to al Qaeda or other extremist groups.

In this case, the terror threat "was on the radar screen" well before al Qaeda leader Osama bin Laden was killed May 2 in Pakistan, one law enforcement source said.

The arrests grew out of another investigation that also began long before bin Laden's death, officials said.

After the arrest in May, Jewish Federations of North America President and CEO Jerry Silverman released a statement saying his group was "disturbed by the news reports of a homegrown terror plot aimed at Jewish communal institutions in New York City."

In the wake of bin Laden's death, he says, the federation is endeavoring to help "communities be prepared, alert and secure against the heightened threat."

"Any threats to the safety of New Yorkers will be addressed swiftly and aggressively by this office and our partners in the NYPD," Vance said Wednesday.