The NYPD has notched a pretty good record working with federal authorities to frustrate terror plots here in New York.

Well, guess what?

When the feds get cold feet and drop out, New York’s Finest still manage to get the job done.

Case in point: Manhattan District Attorney Cy Vance this week announced a guilty plea from Ahmed Ferhani, one of two men arrested in spring 2011 on charges of plotting to blow up several Manhattan synagogues and churches.

This is New York’s first successful state-level prosecution of a terror case.

Previous cases were run by the US Attorney’s Office and Justice Department, usually following coordination between the FBI and the NYPD.

This time, however, the FBI’s Joint Terrorism Task Force opted out, claiming the case was “overhyped” and couldn’t be successfully prosecuted.

The only thing “overhyped,” of course, was the Associated Press’ journalistic jihad against the NYPD — a months-long effort to impugn the department’s integrity that won the press agency a Pulitzer Prize while substantially undercutting public confidence in the world’s best police force.

The AP’s project certainly gave cover to the defendants in this instance.

Algerian-born Ferhani screamed from Day One that he and co-conspirator Mohamed Mamdouh had been “entrapped” into purchasing guns and a grenade.

But, with the feds out of the picture, the NYPD’s intelligence team and DA Vance’s rackets division monitored and tracked Ferhani — building a rock-solid case.

Indeed, wiretap evidence of Ferhani calling Jews “rats” and wanting to be a “mastermind” behind wanton destruction was enough to produce a guilty plea.

The result: Ten years up the river for the aspiring terrorist, almost certainly to be followed by deportation.

The essential thing to keep in mind is that, once again, NYPD due diligence is responsible for putting away a dangerous individual who, left to his own devices, might already have created deadly mayhem.