This article has been updated to reflect news developments.

At New York’s City Hall, the need for oversight is clear as ever.

That is the biggest takeaway after Mayor Bill de Blasio fired one of his harshest critics, Mark Peters, commissioner of the Department of Investigation, the city’s semi-independent watchdog agency. That dismissal set off a fiery exchange of words between the men that has prompted questions about the ethical behavior of them both.

In the letter firing Mr. Peters, city officials cited an independent review this year by a former federal prosecutor, James McGovern, accusing Mr. Peters of abusing his powers by taking over an agency that investigates misconduct in public schools and firing its top official after she said the takeover violated the law. The review did not call for Mr. Peters’s ouster.

Mr. Peters’s response to his dismissal was swift and biting. In a letter on Monday, he suggested the mayor had fired him in part because of continuing investigations into the de Blasio administration. He also said Mr. de Blasio had pressured him not to release some of the agency’s reports, including one on lead paint hazards in the city’s public housing buildings. Another time, Mr. Peters said, Mr. de Blasio called him on the phone and asked him not to release a report critical of the city’s child welfare agency, yelling at him when he said he planned to make the document public anyway.