Mayor Bill de Blasio went scorched-earth against charter schools at a teachers union-sponsored education forum for Democratic presidential contenders, bellowing, “I hate the privatizers and I want them to stop them.”

De Blasio made the comments as part of his opening statement at the National Education Association’s annual assembly in Houston on Friday.

“I’m going to be blunt with you, I am angry about the state of public education in America,” the struggling 2020 candidate shouted.

“I am angry about the privatizers. I am sick and tired of these efforts to privatize a precious thing we need — public education. I know we’re not supposed to be saying ‘hate’ — our teachers taught us not to — I hate the privatizers and I want to stop them,” he said.

Asked about high-stakes testing, de Blasio pivoted back to charters.

“Get away from high-stakes testing, get away from charter schools. No federal funding for charter schools,” he said.

“By the way, too many Republicans, but also too many Democrats, have been cozy with the charter schools,” de Blasio added.

“Let’s be blunt about it. We need to hold our own party accountable, too. And no one should ask for your support, or no one should be the Democratic nominee, unless they’re willing to stand up to Wall Street and the rich people behind the charter school movement once and for all,” he said.

Charter operators, who are able to run their schools outside the constraints of union demands, said the mayor is missing the point — that educating children is the ultimate goal.

“There’s nothing new about de Blasio’s cozying up to teachers’ unions and expressing hatred, even for high-quality public charter schools,” said James Merriman, CEO of the New York City Charter School Center.

“While he is busy campaigning in distant states and denouncing Democratic leaders for their lack of ideological purity, charter and district educators will continue to work together to create brighter futures for New York City’s children,” Merriman said.

And Ann Powell, spokeswomen for Success Academy Charter Schools, the city’s largest charter network, noted, “It’s sad to see de Blasio trashing charter schools to advance his political ambitions rather than thinking about the needs of the more than 123,000 children here in New York City -— most of them children of color -— who attend the charter schools he so reviles.”

De Blasio has struggled to gain traction in the crowded field of 24 Democratic presidential contenders — a July 2 Quinnipiac poll put him at less than 1 percent. The NEA represents 3 million public educators.