NEW YORK (CBSNewYork) – Seven members of the NYPD appeared in court Thursday on charges stemming from a prostitution and gambling ring officials said.

Sources said the Internal Affairs Bureau investigation began in 2015 following a tip from another officer. Since then, sources said investigators have collected thousands of hours of surveillance, including wiretaps, of the officers allegedly involved.

They’re accused of providing protection, including information about ongoing investigations, for illegal prostitution and gambling locations in Sunset Park, Brooklyn and Jackson Heights, Queens.

“I’m going to be blunt, because when something like this happens there’s only one way to be, and that’s straightforward, transparent, and unequivocal,” Police Commissioner James O’Neill said at a news conference. “As we sit here today, the reality is that a number of our uniformed members of various ranks have tarnished the shields that they wore. They have ruined their own careers and reputations. But 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.”

The suspects have been identified as Sergeants Carlos Cruz, 41; Louis Failla, 49; Cliff Nieves, 37; Officers Steven Nieves, 32; Giancarlo Raspanti, 43; and Detectives Giovanny Acosta-Rojas, 40; and Rene Samaniego, 43.

The charges against them include promoting prostitution and enterprise corruption.

Sources said a retired NYPD detective was arrested as a “major player” in the case.

Two other uniformed officers were put on modified desk duty and stripped of their guns and badges, including a detective from the 72nd Precinct who is being investigated but not charged.

Sources said more than 40 civilians were also being sought for their alleged participation in the illegal activities.

The Queens County District Attorney will handle the prosecution of the case.