Mayor de Blasio was heckled and hammered at the debate on a slew of issues plaguing New York City — and tried to wriggle out of the hot seat by shifting blame and giving half-answers.

On the Eric Garner case:

A group of about 10 people shouting “Fire Pantaleo” interrupted de Blasio during his opening statement, calling on him to boot NYPD Officer Daniel Pantaleo, who was accused of putting Eric Garner in a deadly chokehold five years ago.

The Justice Department said last month it would not bring federal charges against Pantaleo — so de Blasio tried to blame the feds for not prosecuting him on civil-rights charges.

He also didn’t say whether he would fire Pantaleo.

“I know the Garner family. They’ve gone through extraordinary pain. They are waiting for justice and are going to get justice. There’s finally going to be justice. I have confidence in that, in the next 30 days, in New York,” he said.

On NYCHA’s lead crisis:

Hizzoner blamed the federal government’s disinvestment in public housing for NYCHA’s woes.

“That’s part of why we have this lead crisis to begin with,” he said.

He even credited his handling of the problem, which has scandalized his administration: “I’m in charge of the largest city in this nation, You do not accept the status quo, you fix it.”

Conveniently, de Blasio didn’t mention that the situation at ­NYCHA was so dire, the feds ­installed a monitor to oversee the agency and ordered his administration to fix the problems.

Other cringe-worthy ­moments:

De Blasio tried to insert himself into a back-and-forth about the war in Iraq — by bringing up Iran.

“Let’s talk about Iran. We didn’t talk about Iran!” de Blasio interrupted, saying, “There’s a march to war in Iran right now and . . .”

“Please the rules, please follow the rules,” moderator Don Lemon interjected before cutting off de Blasio, who had continued talking.