Police Commissioner Raymond Kelly says one of the suspects also expressed interest in bombing the Empire State Building.
Mayor Michael Bloomberg says the two suspects plotted to bomb a "major synagogue" in Manhattan and bought several weapons and a hand grenade from an undercover officer.
The men, identified as Mohamed Mamdouh and Ahmed Ferhani, were arrested Wednesday night in Midtown. Both were arraigned in Manhattan court Thursday. They were being held without bail and face life in prison if convicted. Their lawyers say their clients deny committing any crimes.
Officials said they had been watching Ferhani, 26, for several months and that he had said he was fed up with the way Muslims were treated around the world. He's the one who expressed interest in the Empire State Building attack, Kelly said.
"They're treating us like dogs," Ferhani said once, according to Kelly.
Ferhani showed a pattern of growing anger, Manhattan District Attorney Cyrus Vance said.
"His plans became bigger and more violent with every passing week," Vance said.
The men were charged under state terror laws. They are Americans of Algerian and Moroccan descent.
Police Commissioner Raymond Kelly said the suspects have no known connection to al-Qaida.
Federal prosecutors are aware of the case, but declined to charge them under federal terrorism laws.
This is the 13th plot thwarted against the city since the September 11th attacks, and the kind of homegrown, "lone-wolf" scenario that federal law enforcement officials were recently warned of.
Attempts by the men to buy weapons were detected by investigators with the NYPD's Intelligence Division, who moved in to set up a sting.
Ferhani lives in Queens. Authorities say he was apparently going to sell drugs to buy the guns.
The neighborhood where Ferhani lived is well kept, tree lined and surrounded by two family homes. A large satellite dish and a tiny video camera hang outside the house in Whitestone,Queens. Ferhani's brother says his family has as many questions after hearing of his arrest.
"My brother did get arrested. If you do want to get information, go to court. That is how I will get information," Mohamed Ferhani said.
Residents were stunned to hear one of their neighbors is being called a terrorist. Many asking their names be withheld
Ferhani lives in the basement of his family's home. Police searched it on Wednesday, taking a computer and personal items.
Ferhani was raised in Algeria as Muslim, but left the country with family in 1994 during the civil war.
He used to sell cosmetics at Saks 5th Avenue, but quit.
His LinkedIn page says his profession is "hospitality." Ferhani describes himself as a highly motivated, sales trainer/associate with great organizational skills. He goes onto say he welcomes challenges and new responsibilities.
What he does not mention is his rap sheet. He was arrested for robbery in 2003 and one neighbor suspected he was breeding pit bulls for fighting.
Authorities said the plan was already in the works at the time of Osama bin Laden's death, and is not believed to be in retaliation for the killing.
New York City police have been on high alert for potential threats to the city since the U.S. raid that killed the al-Qaida leader over a week ago.
"We are concerned about lone wolves acting against New York city in the wake of the killing of bin Laden," Bloomberg said. "Those perhaps are the toughest to stop."