A decision to enlist a Queens imam in an effort to develop information about the man at the center of a long-running cross-country terrorism investigation backfired earlier this month.

In fact, federal prosecutors have now charged the imam, a onetime source of information for the New York Police Department, contending that he betrayed the police by warning the suspect and then lied about it, and maybe even coached him on what to say if he was questioned.

Several law enforcement officials have said the imam’s disclosures went a long way toward forcing their hand in an extremely sensitive investigation of a possible Qaeda plot. The situation left them scrambling to conduct raids and arrest the suspect sooner than they might have otherwise, a development that they said could make it harder to identify others involved and develop evidence against them.

Several officials  all of whom spoke on the condition of anonymity because much of the investigation is classified  have said that the inquiry, which had been under way for months, could well have continued, tracking the communications, meetings, plans and associates of the suspect, Najibullah Zazi, 24.