Mayor Rahm Emanuel and his handpicked Police Supt. Eddie Johnson fired back at Toni Preckwinkle on Monday for saying she would dump Johnson because he “refused to acknowledge that there was a code of silence” in the Chicago Police Department.

Johnson said he “came on this job with my integrity and my honor and that’s the way I’m going to leave this job.”

Without mentioning Preckwinkle by name, Johnson accused the county board president, now running for mayor, of misconstruing or misinterpreting what he had to say about the code of silence in a deposition.

“I never denied that. That’s a fact. The fact is, when you go into a court to testify, you’re testifying truthfully to what you know. I can’t cite specific examples of things like that,” he said.

“From day one, I have acknowledged that there’s racism on the police department. From day one, I have acknowledged that there’s misconduct. From day one, I have also said that’s a small minority of police officers. The majority of these men and women are doing the right thing for the right reasons.”

Johnson said he has even “put in mechanisms to help create a platform” so that officers don’t feel so “stigmatized” that they “cannot report misconduct if they see it.”

“I have led a reform effort that’s unprecedented in the Chicago Police Department. The fact is, when you change a culture, you can’t do that in one or two years . . . It takes time to do that,” Johnson said.

“So the facts are this: I don’t tolerate misconduct. I never denied anything like that. When I testify in court, I do it factually. But we have a responsibility as leaders to get the facts right.”

Emanuel said he “couldn’t be prouder” of how Johnson has performed in the two years since the mayor did an unprecedented end-run around the police board to pick Johnson, who hadn’t even applied for the job.

“The superintendent . . . has led an unprecedented transformation of our police department, its culture, its training, its rank and file, its investment and adoption of technology and also seeing significant reductions two years in a row . . . on shootings, homicides and robberies,” the mayor said.

“To see that reduction at the same time that you’re making fundamental changes to the police department is a testament to his leadership and the leadership team he’s put in place . . . So I can’t be prouder of the selection . . . He’s done it at a time of challenge and he has stepped up and showed his true character.”

Emanuel even went so far as to compare Johnson to Matt Nagy, head coach of the worst-to-first, NFC North champion Chicago Bears.

Last week, Preckwinkle told the Chicago Sun-Times that, if she is elected mayor of Chicago, Johnson will be looking for a new job or living off his police pension.

“He refused to acknowledge that there was a code of silence in the police department….I don’t think that’s an honest statement,” Preckwinkle said.

“It’s very important that police be accountable for their conduct. And if you won’t even acknowledge that there’s a code of silence in the police department, how can you possibly do that? . . . If you start out by saying . . . we have never condoned or covered up bad police behaviors, I don’t think that’s a characteristic of an effective leader.”

In a December 2015 speech to the City Council, Emanuel famously acknowledged that there is a code of silence in the Chicago Police Department to quell the political furor that followed the court-ordered release of the Laquan McDonald shooting video.

But that didn’t stop Johnson from testifying under oath that he was unaware of any such code to protect officers accused of misconduct.

It happened during a deposition tied to the wrongful death lawsuits brought by the estates of Quintonio LeGrier and Bettie Jones.

“Again, in my personal experience, I’ve never heard an officer talk about code of silence. I don’t know of anyone being trained on a code of silence. That’s in my personal experience,” Johnson, a 30-year veteran, was quoted as saying in the deposition.

Ald. Nick Sposato (38th), was more direct in criticizing Preckwinkle after joining Emanuel and Johnson at the police academy to greet the latest class of police recruits that completed Emanuel’s two-year promise to hire 1,000 police officers above and beyond attrition.

“If she wants to get rid of Eddie Johnson, I have no problem with that. If she’s the mayor, she can pick whoever she wants. But to say it now and criticize a man who’s doing an awesome job — I didn’t appreciate it . . . I think that’s unconscionable. It’s just a political ploy,” Sposato said.