OSLO — It was already past midnight on Friday when the news arrived in Norway: A day after meeting with Norway’s prime minister in Washington, President Trump told members of Congress that the United States needed more immigrants from places like Norway and fewer immigrants from countries like Haiti.

Many in this prosperous Scandinavian country were already asleep, but several prominent Norwegians who were still online took to Twitter to vent their outrage and disgust, not only at Mr. Trump’s vulgar language but at what many saw as a racially tinged insult.

“The real White House: Trump calls Haiti and African countries ‘shithole’ countries to the face of members of Congress, and uses Norway to prove his racism,” wrote Andreas Wiese, a newspaper commentator who manages the House of Literature, a popular cultural center in Oslo, Norway’s capital.

Prime Minister Erna Solberg’s visit to Washington to meet Mr. Trump — where they held a joint news conference on Wednesday at the White House — was big news in Norway, and the encounter had not gone without a hitch: Mr. Trump pointed to the sale of American-made “F-52s and F-35 fighter jets,” a remark that puzzled many listeners since there is no such thing as an F-52 fighter jet. (There are F-52s in the video game “Call of Duty: Advanced Warfare.”)