President Barack Obama said he faced a candidate similar to Donald Trump eight years ago in his first White House bid — and he said they’re both symptomatic of the deeper problems within the Republican Party.

“I see a straight line from the announcement of Sarah Palin as the vice-presidential nominee to what we see today in Donald Trump — the emergence of the Freedom Caucus, the Tea Party and the shift in the center of gravity for the Republican Party,” Obama told Jonathan Chait in a lengthy New York magazine interview.

ADVERTISEMENT

He’s not terribly optimistic that the GOP will change without some serious soul searching — regardless of who wins the Nov. 8 election.

“Whether that changes, I think, will depend in part on the outcome of this election, but it’s also going to depend on the degree of self-reflection inside the Republican Party,” Obama said. “There have been at least a couple of other times that I’ve said confidently that the fever is going to have to break, but it just seems to get worse.”

Obama said he has gotten along with individual Republicans during his presidency, but conservative media insist on an ideology purity that makes compromise impossible.

“We can have really great conversations and arrive at a meeting of the minds on a range of policy issues, but if they think they’re going to lose seats or that they’re going to lose their own seat because the social media has declared that they sold out the Republican Party, then they won’t do it,” he said.

Obama cited two examples of GOP politicians who were punished for associating with him in public.

ADVERTISEMENT

“They’re looking at Charlie Crist down in Florida,” he said. “One hug [from me] and he was toast. Chris Christie couldn’t get his presidential race launched — it was basically over before it started — because he was too friendly and cooperative with me in accepting federal aid for a state that had been devastated by a hurricane.”

“They’re imagining the potential problems that arise, so it’s pretty hard for them to publicly say, ‘Obama’s a perfectly reasonable guy, but we just can’t work with him because our base thinks he’s the Antichrist,'” Obama continued. “It’s a lot easier for them to say, ‘Oh, the guy’s not listening to us,’ or, ‘He’s uncompromising.'”

Obama said he understands that and isn’t particularly troubled by that dynamic, and he even offers to help by attacking his GOP friends in public.

ADVERTISEMENT

“Sometimes I tease them about it behind the scenes,” he said. “I’ll tell them, ‘Look, if you need some help, me attacking you or you know.’ And the times where we have gotten things done, it has been very important for me to, frankly, help them try to manage their base.”