Mayor de Blasio turned into Hillary Clinton’s chief attack dog on Friday, blasting Bernie Sanders for criticizing her ties to the fossil-fuel industry.

“This attack is not becoming of him, is not becoming of that movement to bring about more progressive change. And I think we should just get back to the issues,” de Blasio said of Sanders during a conference call with reporters arranged by the Clinton campaign.

The mayor was referring to a dispute that began Thursday when a Greenpeace activist confronted the Democratic front-runner after an event at SUNY Purchase and asked about donations she received from fossil-fuel interests.

Clinton’s angry response was caught on video.

“I have money from people who work for fossil-fuel companies. I am so sick of the Sanders campaign lying about me,” she snapped while jabbing her finger at the activist.

Sanders hit back Friday, in a morning TV appearance and at a rally in Sheboygan, Wis., that night, insisting Clinton owed his campaign an “apology.”

He cited a Greenpeace analysis that said fossil-fuel interests pumped $4.5 million into to Clinton’s campaign or super PACs.

He said the contributions came from 57 oil, gas and coal industry lobbyists, including 11 who bundled more than $1 million.

“We were not lying. We were telling the truth,” Sanders said.

De Blasio, who has endorsed Clinton but has also praised Sanders’ progressive stances, came to the former secretary of state’s defense.

“Any suggestion that she’s in anyone’s pocket on the issue of climate change or on any other issue is flat-out false and just inappropriate,” the mayor said.

He also praised Clinton for showing “political courage” by proposing to reduce Americans’ reliance on coal and pushing to end tax breaks for fossil fuels.

Earlier Friday, Clinton’s team attacked Sanders for his votes against gun control, bringing forward the parents of a 24-year-old woman killed in the 2012 mass shooting at an Aurora, Colo., movie theater.

Speaking to reporters in a campaign call, Sandy Phillips, mother of victim Jessica Ghawi, recalled meeting with Sanders on his vote to exempt gun makers from liability for gun violence.

“When we talked to Bernie, he stood by his vote and was not willing to really discuss anything to do with guns . . . What stance he does have, he flip-flops quite often,” she said.