The president grew frustrated as senators discussed revamping rules affecting people from Africa, El Salvador and Haiti, sources said.
“Why are we having all these people from s***hole countries come here?” he told lawmakers, according to the Washington Post.
The White House has not denied the comment which was widely reported in the US media.
“Certain Washington politicians choose to fight for foreign countries, but President Trump will always fight for the American people,” said White House spokesman Raj Shah.
His statement continued: “Like other countries that have merit-based immigration, President Trump is fighting for permanent solutions that make our country stronger by welcoming those who can contribute to our society, grow our economy and assimilate into our great nation.
“He will always reject temporary, weak and dangerous stopgap measures that threaten the lives of hardworking Americans, and undercut immigrants who seek a better life in the United States through a legal pathway.”
Mr Trump’s remark reportedly came as senators from both parties visited the Oval Office to propose a bipartisan immigration deal.
But the White House rejected their proposed agreement, plunging the issue back into uncertainty.
During their conversation, Democratic Senator Dick Durbin had been discussing temporary residency permits granted to citizens of countries struck by natural disasters, war or epidemics.
But Mr Trump suggested that instead, the US should allow more entrants from countries like Norway, whose Prime Minister he met with this week.