"We need to reject any politics that targets people because of race or religion," Obama said in his final State of the Union Address.
He acknowledged that many Americans felt frightened and shut out of a political and economic system they view as rigged against their interests and slammed Republicans who are playing on those insecurities in the presidential race.
"This isn't a matter of political correctness. It's a matter of understanding what makes us strong. The world respects us not just for our arsenal; it respects us for our diversity and our openness and the way we respect every faith," Obama said without naming anyone.
Obama argued that the country can confront the challenges of the future only if people embrace change.
More From This Section
"When politicians insult Muslims, when a mosque is vandalised, or a kid bullied, that doesn't make us safer," he noted.
"That's not telling it like it is. It's just wrong. It diminishes us in the eyes of the world. It makes it harder to achieve our goals. And it betrays who we are as a country," Obama said.
Obama said "one of the few regrets" of his presidency was that - after he ran on a message of unity and healing - American politics had become more divided and resentful on his watch.
"It's one of the few regrets of my presidency, that the rancour and suspicion between the parties has gotten worse instead of better," he said, in his final State of the Union address.