Mayor de Blasio’s penchant for making himself a party pariah continued this weekend as he blithely inserted himself into the heated race for Democratic National Committee chairman, and then angered New York Dems by backing a Californian for another post.

Allies of Rep. Keith Ellison of Minnesota, who entered Saturday as one of two leading contenders for DNC boss, “asked him not to come,” said a Democratic Party source. “The buzz is, what the f–k was he doing here?”

The mayor arrived at the party’s winter meeting in Atlanta on Friday just hours after being grilled by US Attorney Preet Bharara, who is investigating de Blasio’s campaign fund-raising activities.

“They were like, ‘Oh come on, really?’ They’re not happy he’s here,” said the source.

“This is 100 percent one way for him and it gets him thinking that he’s a national player,” said a labor bigwig.

De Blasio was passed over for the plum role of giving one of three nominating speeches on Ellison’s behalf before party members voted on Saturday, electing former Labor Secretary Tom Perez on the second ballot.

The mayor had to settle for giving a seven-minute stemwinder at a private soirée for Ellison boosters on Friday night, where he bashed his own party for cozying up to Washington insiders.

“We are under assault, brothers and sisters. Somehow our party over the years lost its way,” he said. “When they looked at our party, too many people .?.?. saw a party of lobbyists and consultants, a party of Washington, DC.

“Tomorrow we get to do something that should have been done decades ago. Keith Ellison is a man of destiny,” he thundered. “We can have a chair that will change this party and return it to the grass roots, and that is Keith Ellison.”

De Blasio remained a looming presence on Saturday as party members got down to the business of voting in a new chairman in the first contested DNC race since 1988.

He towered over Ellison as he gave him a bear hug outside the ballroom where voters gathered, then worked the floor as party insiders filled out their first round of paper ballots.

He seemed at loose ends when the voting went to a second ballot and it became clear he had backed the wrong horse. Observers spotted him leaning against a wall alone, gazing at his phone.

Meanwhile, the mayor managed to anger local Dems as he aggressively pushed a California candidate for one of three vice-chair slots — pointedly ignoring two New Yorkers, Rep. Grace Meng of Queens and Assemblyman Michael Blake of The Bronx, who were also vying for the job.

“Personally, I think it’s an embarrassment,” a Bronx Democrat said about de Blasio’s California scheming. The vote for vice chair had not concluded by press time.

Both Blake and Meng requested de Blasio’s support when they launched their bids — but the mayor turned them down, Politico reported.

He snubbed Meng Friday night when he neglected to drop in at a party for her that was held next door to the Ellison event where he spoke.

Gov. Andrew Cuomo and Sen. Kirsten Gillibrand have both endorsed them, and Sen. Chuck Schumer boosted Blake in a letter sent to DNC members on Friday. Former mayoral rival Christine Quinn roamed the conference halls wearing buttons touting Blake and Meng.

Doubling down, the mayor issued a statement on Saturday in favor of Maria Elena Durazo, a California labor activist.

“She is a seasoned grass-roots organizer and electoral strategist. She has long fought for immigrant rights and justice for working families,” he wrote.

“Her voice in the DNC leadership is critical if the Democratic Party wants to live up to its values as the party for working people everywhere.”

De Blasio’s support for Ellison, who was backed by Sen. Bernie Sanders of Vermont, reminds insiders of his reluctance to back Hillary Clinton against Sanders in last year’s primary — and the humiliating door-knocking assignment he took on when he finally caved and endorsed her.

“It’s a bookend to showing up to Iowa for Hillary when the Clinton people asked him not to come and no one wanted to be near him,” the DNC source said.

De Blasio, who worked in Bill Clinton’s presidential administration and managed Hillary Clinton’s 2000 campaign for US Senate, took months to endorse his fellow New Yorker’s presidential bid, finally coming around as the first primaries and caucuses were about to begin.

When he did, Clinton told him not to bother traveling to Iowa to campaign for her as a surrogate — but eventually allowed him to knock on doors and talk to rural voters one-on-one, a lowly job just a rung above phone-banking and licking envelopes at campaign headquarters.

“I said, ‘Fine, you know, I’ll go wherever you want,’?” de Blasio told the New York Times at the time. “Then the answer was .?.?. we need people who want to really do work in Iowa, because, of course, Iowa is about direct voter contact.”

Our editors found this article on this site using Google and regenerated it for our readers.