NEW YORK — There is enough evidence to support a rare state-level terror case against a man charged with plotting to blow up synagogues, a judge ruled Monday in declining to throw out the charges.
The ruling puts the case against Ahmed Ferhani on course toward a trial that will probably pit authorities’ picture of a homegrown, lone wolf terrorist against his lawyers’ account of a mentally unstable man entrapped by police. No trial date has been set.
‘‘At the end of the day, we’ll see what the jury says,’’ one of his lawyers, Elizabeth Fink, said after court Monday.
Ferhani, 27, an Algerian immigrant, and codefendant Mohamed Mamdouh were arrested in May 2011 after Ferhani bought three handguns, ammunition, and an inert grenade from an undercover detective, police said.
Mamdouh, 21, an American citizen of Moroccan descent, had been dropped off nearby before the buy and was arrested soon afterward, according to police. Both have pleaded not guilty. Monday’s ruling involved only Ferhani.
Authorities said the two planned an attack to avenge what they saw as mistreatment of Muslims around the world. Ferhani suggested posing as a Jew so he could infiltrate a synagogue and leave a bomb inside, prosecutors have said in court documents.
Most terror cases are federal, but Ferhani and Mamdouh were charged under a state law passed shortly after the Sept. 11, 2001, terrorist attacks.
The case hit a bump early on, when a grand jury declined to indict the two men on the initial top charge against them, a high-level terror conspiracy count. But they were indicted on other terror and hate crime charges that carry up to 32 years in prison.
Ferhani’s lawyers sought to get those charges dismissed, saying the case was based on insufficient evidence, drew on dubious police tactics, and mistakenly invoked a terror law to prosecute what was an alleged street crime.
Manhattan state Supreme Court Justice Michael Obus disagreed.
‘‘The overt acts alleged in support of the conspiracy charges — and again, reflected in the evidence before the grand jury — assert (Ferhani’s) very tangible plans to use the weapons in a religiously motivated fashion against Jews and other non-Muslims,’’ Obus wrote in his ruling Monday.
Ferhani’s lawyers say police manipulated a man they knew had psychological problems to turn ambiguous remarks and a staged weapons buy into a trumped-up terror case. Ferhani has been institutionalized for psychiatric problems as many as 30 times — at least five of them after his family called police, his lawyers have said.
‘‘We think this is a case that was brought in bad faith to justify the illegal and unconstitutional campaign of the police and the district attorney’s office to further their agendas . . . and to criminalize the Muslim community,’’ Fink said after court.
In court papers, Fink had cited stories by the Associated Press that described efforts to monitor Muslim student groups throughout the Northeast and to compile the names of Moroccan cab drivers. Police officials and Mayor Michael Bloomberg have said the surveillance effort was legal, constitutional, and vital to protecting the city.
Ferhani’s lawyers lambasted the conduct of prosecutors, as well as police.
The defense attorneys said Monday that prosecutors had impinged on Ferhani’s communications with his lawyers by seizing the cellphone of a female companion — his lawyers say she is his common-law wife, while prosecutors term her his girlfriend. She had exchanged text messages with one of the lawyers, Lamis Deek, about questions Deek had for Ferhani, the lawyer said.
Prosecutors argue that attorney-client privilege did not apply to the messages to the woman.