Bill Bratton has taken a small but significant step to formally disband the widely acclaimed and equally reviled anti-terrorism program of predecessor Ray Kelly -- one the department denied even existed: the Demographics Unit.

Just as Kelly had quietly begun cutting back on stop-and-frisk amid the political furor the program caused, he also had started disbanding the 16-person unit, which was first revealed in 2011 by The Associated Press.

When Bratton took control of the NYPD earlier this year, the unit -- in which undercover officers mapped Muslim neighborhoods to identify potential terrorists -- was down to three detectives and a sergeant.

"We didn't disband anything," said a top NYPD official, referring to the unit. "We only put it out of its misery. The only thing we disbanded was a lie -- that it never existed or that it ever worked."

The program was geared more toward gathering information than generating cases. Still, its commander, Chief Thomas Galati, acknowledged in a 2012 federal civil rights lawsuit that the unit had never generated a single lead nor triggered a single terrorism investigation.

Closing an ineffectual unit should be a no-brainer. Nonetheless, Bratton's announcement that he is shutting it created a furor among those who support Kelly and his terrorism policies.

"Disconnecting the dots," read the headline of a New York Post editorial, while calling the unit "a vital anti-terror program."

In its editorial headlined "NYPD Blind," The Wall Street Journal quoted Kelly's former director of intelligence analysis, Mitchell Silber, saying the unit was "critical in identifying" an Islamic bookstore in Brooklyn "as a venue for radicalization.

"Information the unit collected about the store provided a predicate for an investigation that thwarted a 2004 subway plot against the Herald Square subway station," Silber said.

Referring to the Demographics Unit, the Daily News headlined an op-ed piece: "NYPD's 'Muslim Mapping' Saved Lives." It was written by former Kelly NYPD spokesman Paul Browne, now a vice president at Notre Dame who at one time denied the unit existed.

But a former FBI agent in charge of the New York office of the Joint Terrorism Task Force who took the unusual step of going public maintains that the Demographics Unit failed to detect the most serious terrorism threat to the city since 9/ll -- the subway bombing plot of the Denver-based al-Qaida operative Najibullah Zazi.

Writing in the Daily News last week, Don Borelli said the unit kept files on Zazi's neighborhood in Flushing, where he had grown up, while he was becoming radicalized.

The unit, he wrote, kept files on local businesses and "even visited the travel agency where Zazi bought his ticket to Afghanistan for terrorism training."

So, asked Borelli, "why wasn't Zazi identified until he was driving to New York from Denver to blow up the subway? Because the program was ineffective. The mission of the Demographics Unit was to spot the terrorists in the haystack, but again and again it failed to do so."

Borelli wrote that Galati admitted in a deposition that certain Muslim establishments would be visited on multiple occasions. "Not because they were hotbeds of terrorism, but because the food was good," he wrote. "In essence, New York City taxpayers were paying for good falafel, not good information."