Bronx Councilman Ruben Diaz Sr. interrupted a City Council sensitivity training on Wednesday, yelling that he wouldn’t “rat” if he saw sexually harassment happening at the council’s offices, sources who were at the training said.

The outburst came during the annual training when a lawyer asked the lawmakers what they would do if they overheard a staffer making lewd comments to a female co-worker in an elevator, the sources said.

“I’m not gonna rat my people out! This place is full of rats!” Diaz blurted out, according to the sources. “So we’re supposed to be rats?”

City Council Speaker Corey Johnson then stood up and attempted to tell Diaz that they have an obligation to report sexual harassment in the workplace.

The two argued back and forth during the exchange until Diaz agreed to be quiet until the end of the presentation.

When he started to speak again at the end of the training, several council members left the room in the middle of him talking, a source said.

“The City Council is serious about preventing sexual harassment,” council spokeswoman Jennifer Fermino said Wednesday night. “We have strict rules we abide by which include mandatory training sessions for Council Members and staff.”

The training comes as two members — Barry Grodenchik of Queens and Andy King of the Bronx — face allegations of sexual harassment. King did not attend the training on Wednesday, a council source said.

Diaz, who did not return request for comment, has a history of inflammatory remarks. In February, Johnson called on him to step down after Diaz was quoted in an interview on a Spanish language radio program — picked up by NY1 — saying the city council is “controlled by the homosexual community.”