"The greatness of America comes not from building walls," Obama told the Congressional Hispanic Caucus Institute anniversary awards gala.
Read: Trump says he would send Syrian refugees back if elected
"The anti-immigrant sentiment that has infected our politics is not new, but it is wrong," he said, before adding that "economists agree that immigration does not hurt our economy; it grows our economy."
Trump, a billionaire real estate developer who has never held elected office, has promised, if he wins the White House, to expel immigrants in the United States illegally and to build a wall on the US-Mexico border.
He has also proposed repealing the constitutional right to citizenship of anyone born on US soil.
His incendiary comments on immigration and other issues have dominated the nascent 2016 election campaign, and on Thursday the president condemned the logic of "saying clearly inflammatory things and then saying, 'Well that's not what I meant' -- until you do it again and again."
Read: Trump considers getting 'rid of' Muslims when president
Although he did not name Trump specifically, Obama did denounce the overall tone of the Republican presidential field.
"They have invented this new reality where everything was terrific back in 2008," he said.
"That was the golden era, apparently."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ