President Obama has said he “absolutely” has been the victim of racism during his time in office.
The US President suggested the criticism he faced from “whites in Southern states” was a result of the colour of his skin.
He told CNN: "There's a reason why attitudes about my presidency among whites in Northern states are very different from whites in Southern states.
Trump says Obama is giving him advice on Cabinet appointments
“Are there folks whose primary concern about me has been that I seem foreign, the other? Are those who champion the "birther" movement feeding off of bias? Absolutely.”
Racism was not a major element of mainstream Republican opposition to his presidency but was an issue on the political fringe, he added.
Mr Obama has faced repeated questions about whether he was born in the US – despite there being no evidence he was not.
President-elect Donald Trump is among those who suggested Mr Obama is not really American and that his birth certificate is a fake.
However, Mr Trump has shifted his position in recent months, saying: “President Barack Obama was born in the United States, period. Now, we all want to get back to making America strong and great again.”
Barack Obama hands out his final Presidential Medal of Freedom awards
Mr Obama’s former senior adviser, David Axelrod, who now runs the University of Chicago’s Institute of Politics, agreed that the President had suffered from racial prejudice.
He told CNN: 'It's indisputable that there was a ferocity to the opposition and a lack of respect to him that was a function of race."
Mr Axelrod recounted an incident in which a powerful Republican had told Mr Obama: "You know, we don't really think you should be here, but the American people thought otherwise so we're going to have to work with you."
The comments were made during a CNN documentary special, The Legacy of Barack Obama, that aired on Wednesday night.
Obama: I'll weigh in on Trump's presidency if necessary
Some experts have previously suggested Mr Trump’s shock victory in the 8 November presidential election was a result of racism against Mr Obama.
Michael Tesler, an assistant professor of political science at the University of Columbia, said: “Obama’s presidency rapidly accelerated the pre-existing relationship between party identification and racial attitudes.
“Moreover, he activated a previously non-existent partisan divide according to attitudes about Muslims – one that contributes to partisan sorting even after controlling for racial attitudes."
Barack Obama could thwart Donald Trump’s Muslim registry plan
The issue of race has never been far from the surface during Mr Obama’s presidency. In 2012, following the shooting of Trayvon Martin, an unarmed black teenager in Florida, he divided opinion by saying if he had a son “he would look like Trayvon”.
The current President also came under pressure during the Black Lives Matter protests over the shootings of unarmed black Americans by police officers. Many urged him to do more to support the protestors, while others criticised him for not being stronger in defending law enforcement agencies.
Mr Obama will hand over the presidency to Mr Trump on 20 January.