Robert M. Morgenthau, the Manhattan district attorney, said 27 of the 29 people named in the indictment had been arrested; the other two remain at large. Those indicted include bosses and associates of the Luchese family, officials of four corporations, real estate officials and the six building inspectors.

Image Joseph DiNapoli

The Buildings Department has a history of corruption scandals, including notable ones under the Bloomberg administration. In 2002, 19 of the city’s 24 plumbing inspectors  including the chief inspector and the top supervisors in the Bronx, Brooklyn, Manhattan and Queens  were charged with extorting hundreds of thousands of dollars to approve projects throughout the city.

Last year, two crane collapses in Manhattan, which killed nine people, led to investigations by Mr. Morgenthau’s office and the Department of Investigation that exposed corruption and incompetence in the building agency’s Cranes and Derricks Division and resulted in several arrests.

Amid the problems, Patricia J. Lancaster resigned last year as buildings commissioner, the first commissioner to leave the Bloomberg administration under a cloud of controversy. Her replacement, Robert D. LiMandri, said on Thursday that he was outraged by the charges, and he sought to assure New Yorkers that their safety had not been compromised.

“As a precaution, the department has visited all of the buildings associated with the investigation to ensure safety, and we expect to complete all reinspection work soon,” Mr. LiMandri said. “These former inspectors are accused of betraying the public and this department for their own selfish gain, and they should be prosecuted to the full extent under the law.”