After videotape in the club showed that the officers were lying, Mr. Anderson pleaded guilty to official misconduct and now faces two to four years in prison. (The other officer, Henry Tavarez, also pleaded guilty to a minor charge.)

Mr. Anderson testified this month in the trial of Jason Arbeeny, who worked in Brooklyn and is accused of planting drugs on two people who had never been arrested. Although he testified that he did not know Mr. Arbeeny or have any knowledge of wrongdoing by him, Mr. Anderson’s description of the narcotics units was offered by prosecutors as evidence of what they say is a conspiracy to cover up its lawlessness by routinely falsifying records and keeping stashes of narcotics.

Justice Gustin Reichbach, who is hearing the case without a jury, said he understood why Mr. Anderson would swap an arrest to help a fellow officer who was falling short of his targets, but pressed him on what he had done to innocent people.

“What was your thought in terms of saving his career at the cost of these four people who had seemingly no involvement in the transaction?” Justice Reichbach asked.

IT was called “attaching bodies” to the drugs, Mr. Anderson answered, and he said nearly four years into his life undercover, he had become numb to the corruption.

“It was something I was seeing a lot of, whether it was from supervisors or undercovers and even investigators,” Mr. Anderson said. “Seeing it so much, it’s almost like you have no emotion with it. The mentality was that they attach the bodies to it, they’re going to be out of jail tomorrow anyway, nothing is going to happen to them anyway.

“That kind of came on to me and I accepted it — being around that so long, and being an undercover.”

His testimony was reported Thursday in The Daily News and The New York Post.

At a trial earlier this year, Sean Johnstone, the former officer who Mr. Anderson said had kept the tobacco can in the car, was acquitted by a judge on 34 of 35 various counts of misconduct. Asked about Mr. Anderson’s accusations, the lawyer for Mr. Johnstone, Anthony Ricco said, “Sean’s answer is, ‘I never did a single thing that he said he saw me do.’ ”