The whistle-blower investigation, conducted by a respected former federal prosecutor, James G. McGovern, substantiated complaints made under the city’s whistle-blower law by the two officials who claimed they were fired or demoted because they objected to Mr. Peters’s actions. Mr. McGovern recommended that the officials be reinstated to their former positions with back pay, according to the documents, which were letters sent to the officials.

Mr. McGovern also recommended that Mr. Peters issue a written apology to the former head of the agency, Anastasia Coleman, “for the discourteous and unprofessional manner in which he conducted himself” during a meeting on Feb. 27, the day before he fired her, and that a copy of the letter be placed in both of their personnel files.

The outcome is particularly embarrassing to Mr. Peters and the investigation agency because he violated the city’s whistle-blower law — which was designed to protect those who report municipal wrongdoing from retaliation for speaking out — and is being disciplined for the very same sort of conduct he is supposed to prevent and punish.

Mr. McGovern was hired by Mr. Peters to conduct the whistle-blower inquiry because the commissioner and everyone on his senior staff could play no role since they all were either subjects of the complaints or witnesses to the conduct described in them.

Mr. McGovern, who served for 16 years as a federal prosecutor in the Eastern District of New York, most recently as the chief of the criminal division, detailed his complete findings in a lengthy report provided to Mr. Peters, as is required by the city’s whistle-blower law, on Wednesday.

The full document was described by people with knowledge of the matter as exhaustive and highly critical of the conduct of the commissioner, his first deputy, Lesley Brovner, and his senior staff.

On Thursday, Mr. McGovern sent one-page letters to Ms. Coleman and her lawyer, and to her deputy, Daniel Schlachet, notifying them that their complaints had been substantiated. The letters included his list of recommendations.