“As we sit here today, the reality is that a number of our uniformed members of various ranks tarnished the N.Y.P.D. shields that they’ve worn,” said the police commissioner, James P. O’Neill, at a news conference on Thursday. “They’ve ruined their own careers and reputations. More importantly, they have diminished the great work of tens of thousands of honest, honorable and ethical cops. And that should make every cop who has ever done this job angry.”

In all, three sergeants, two detectives and two officers have been charged in the prostitution enterprise. Twenty-six civilians were also arrested, and at least 13 more are being sought. Officials said there are no expectations that other police officers will be arrested unless new information surfaces.

The man accused of being the group’s ringleader, Ludwig Paz, 51, a former vice detective, used his knowledge of the workings of the Police Department to his advantage, prosecutors charged.

He knew that undercover officers investigating prostitution are not allowed to expose their genitals during their interactions with suspects, and so he made a rule to check new customers of the brothels: He insisted that the men “undress and allow themselves to be fondled to pass the brothel’s security screening,” the Queens district attorney’s office, which is prosecuting the officers and dozens of civilians, said.

“The evidence in this case is overwhelming,” Bradley Chain, the senior assistant district attorney on the case, said at the officers’ arraignment on Thursday in State Supreme Court in Queens. “There are thousands of hours of surveillance.”