President Obama has one message for Republicans wary of the unexpected rise of Donald Trump to the top of their ranks: You've made your own bed.

Speaking to NPR in a wide-ranging interview, Obama insisted it wasn't his presidency that was responsible for Trump's popularity, but the culmination of GOP opposition throughout his eight years in office.

"Partly in reaction to my presidency and the political decisions that they made, they find themselves having created an atmosphere in which even somebody like [House Speaker] Paul Ryan is viewed as not sufficiently conservative," Obama said of the Wisconsin Republican. "Or if he does just some of the basic work of governance that somehow he has betrayed the base and is decried as a Republican in name only."

Obama also put blame for Trump's popularity at the foot of conservative media, which he said has exploited identity politics.

One of the things that you've seen during the course of my presidency is the ability, the power of a certain slice of the media to emphasize to white working-class voters somehow that [Obama administration policies] are not good for you," the president said in the interview that aired today but was taped Monday.

"That this is Obama and his socialist friends who are trying to take money from you to give to an undeserving, you know, Mexican immigrant or black welfare mom and tapping into sort of an identity politics that was powerful and oftentimes can work."

But Obama insisted he still remains confident that the United States will reject Trump and his message come November, which he said will result in a period of Republican Party soul searching.

"You know, if we get the decisions that need to be made right, then 10 years from now, 20 years from now, we may look back at something like the Trump campaign as the last vestige of a kind of politics of us versus them that really doesn't apply to today," Obama said.

As for the campaign, Obama is set to make his first official appearance alongside Hillary Clinton on the trail Tuesday in North Carolina.