New York (CNN) -- Two men suspected of planning an attack on a Manhattan synagogue with guns and a grenade were arrested Wednesday, marking the end of a seven-month undercover operation by New York police officers. 

The suspects, Ahmed Ferhani and Mohamed 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 at the time placing the weapons in the trunk of his car. Mamdouh was arrested on a street nearby moments later. 

Each faces terrorism and hate-crime-related charges and, if convicted, could confront the prospect of life behind bars without the possibility of parole. 

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. 

His defense attorney, Stephen Pokart, told Manhattan Criminal Court Judge Melissa Jackson that his client "hasn't committed any crime at all." 

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. 

Defense attorney Steven Fusfelda -- while not acknowledging the legitimacy of the charges -- asked for leniency given that the prosecutors' case appeared to hinge more directly on Ferhani, he said. 
What New York borough do they reside in?
Ferhani, a 26-year-old unemployed resident of Queens