Democratic presidential hopeful Michael Bloomberg took jabs at two core Democratic groups by comparing them to the National Rifle Association during his time as NYC mayor.

Speaking in 2007 and 2013, the billionaire ex-mayor publicly denounced the teachers union and the state’s branch of the ACLU by likening the two to the NRA.

Bloomberg first drew the comparison during a 2007 press conference touting his school reform plan, a plan fully denounced by the United Federation of Teachers.

“You always do have the problem of a very small group of people who are single-issue-focused having disproportionate percentage of power. That’s exactly the NRA,” the then-mayor said at the time while arguing that critics of his education proposal were “selfish” and small in numbers.

When asked by a reporter to name the special interest that he was referring to, Bloomberg answered, “No. 1, there’s the UFT. You want to go after somebody, that’s as good an example as anything.”

Fast forward to 2013, his last year in office, the 2020 candidate still found himself at odds with the teachers union, and referenced the NRA in a critique of the UFT’s leadership.

“The NRA’s another place where the membership, if you do the polling, doesn’t agree with the leadership,” Bloomberg said during his then-weekly radio show in 2013.

“It’s typical of Congress, it’s typical of unions, it’s typical of companies, I guess, where a small group is really carrying the ball and the others aren’t necessarily in agreement,” he added.

The mayor made similar remarks about the New York Civil Liberties Union that same year, when the group had been fighting against City Hall’s controversial “stop-and-frisk” policy.

“We don’t need extremists on the left or the right running our police department, whether it’s the NRA or the NYCLU,” Bloomberg said during a speech in front of NYPD brass, according to a transcript of the remarks found on the mayor’s archived website.

“In Washington, some elected officials don’t have the courage to stand up against special interest groups on the right and pass common-sense gun laws. And in New York City, some don’t have the courage to stand up to special interests on the left and support common-sense policing tactics like stop-and-frisk.”

Bloomberg has focused a significant portion of his philanthropic efforts over the years on combating gun violence and the NRA, culminating in the founding of Everytown for Gun Safety, a nonprofit committed to supporting political candidates who vote in favor of gun control measures. The billionaire also largely funds the organization.

Speaking to Politico about the resurfacing of the comments, Bloomberg campaign senior adviser Stu Loeser said that the “reference to the [teachers union] was something Mike said in the heat of the moment that he now regrets.”

A spokesperson for Bloomberg’s campaign could not immediately be reached by The Post for comment.