Former US President Barack Obama has called on Americans to reject language from any of their leaders that feeds hatred or normalises racism.
Mr Obama did not name anyone but his rare comments came after President Donald Trump sought to deflect criticism that his anti-immigrant rhetoric had fuelled violence.
In a speech on Monday, Mr Trump condemned hatred and white supremacy.
He was speaking after 31 people died in mass shootings in Texas and Ohio.
While in office, Mr Obama fought unsuccessfully to restrict gun ownership. He told the BBC in 2015 that his failure to pass "common sense gun safety laws" had been the greatest frustration of his presidency.
He has refrained from commenting on Mr Trump's controversial rhetoric regarding migrants but on Monday issued a statement.
"We should soundly reject language coming out of the mouths of any of our leaders that feeds a climate of fear and hatred or normalises racist sentiments; leaders who demonise those who don't look like us, or suggest that other people, including immigrants, threaten our way of life, or refer to other people as sub-human, or imply that America belongs to just one certain type of people," he said.
"It has no place in our politics and our public life. And it's time for the overwhelming majority of Americans of goodwill, of every race and faith and political party, to say as much - clearly and unequivocally."
During his presidential campaign Mr Trump said Mexican immigrants included drug dealers, criminals and rapists.
More recently, he caused widespread anger by suggesting that four US congresswomen of colour "go back and help fix the totally broken and crime-infested places from which they came". He denied his comments were racist.