Mr. Trump’s latest comments drew criticism from many quarters in the continent.
The African Union told The Associated Press that Mr. Trump’s statement “flies in the face of all accepted behavior and practice.”
On Twitter, President Macky Sall of Senegal wrote: “I am shocked by President Trump’s comments on Haiti and Africa. I reject them and condemn them vigorously. Africa and black people deserve the respect and consideration of all.”
Botswana’s government issued a statement calling the president’s remark “highly irresponsible, reprehensible and racist.”
The statement added: “The government of Botswana is wondering why President Trump must use this descriptor and derogatory word when talking about countries with whom the U.S. has had cordial and mutually beneficial bilateral relations for so many years.”
Across social media on Friday, Africans shared pictures of beautiful beaches, tree-lined streets and glamorous tourist resorts captioned with the insult.
Online and offline, in cafes and shops across the continent, some wondered why the United States had spent millions of dollars to build massive embassies in countries which Mr. Trump held in such low esteem. Others speculated that if Mr. Trump visited their countries, he might revise his assumptions. Still others said that Mr. Trump may have had a point, citing the endemic corruption, public health challenges and poverty in many African nations.
“That’s why we’re being termed a shithole,” Andrew Mataso, a 55-year-old businessman, said on a busy street in Nairobi, Kenya.
Vincent Omondi, who lives in a sprawling working-class neighborhood of Kibera, in Nairobi, pointed out that America had a long relationship with people from the countries Mr. Trump criticized.
“The USA,” he wrote in a Facebook message, “was partly built by slaves from the ‘shithole’ countries.” But Mr. Omondi said poverty and economic dysfunction across Africa lent support to Mr. Trump’s point.
“Do I care?” Mr. Omondi said. “Not really, but such statement coming from the leader of the ‘free world’ should serve as a wake up call for Africans to build Africa.”
Alpha Bah, a 24-year-old shop owner in Dakar, Senegal, agreed that the president’s description was correct. If it wasn’t, he said, thousands of migrants wouldn’t risk their lives trying to flee to Europe. “Nobody wants to be in a shithole,” he said.
Oyenka Nwenze, a 26-year-old broadcaster, was stocking up on cooking ingredients for the weekend at a supermarket inside the Silverbird shopping mall in Abuja, Nigeria, an expansive retail space that includes a cinema, several restaurants and boutiques.
He called Mr. Trump racist.
“For someone in that position he should know better, and he doesn’t even try, he isn’t attempting to expand his knowledge base,” Mr. Nwenze said. “In Africa we are normal human beings.”
Dante Ndoma-Egba, 34, runs The Cube, a hipster hangout in Abuja that sells books by Nigerian authors and coffee from Nigerian-grown beans. He called Mr. Trump “a voice of thinking Americans because he was elected, is backed by a majority of legislators.”
Like anywhere, Nigeria isn’t perfect, he said, calling it “a mixed bag of impoverishment, poor governance and beauty.”
“A lot of what he says comes from ignorance,” Mr. Ndoma-Egba said. “The reality is that immigration is a part of Western life, it’s been happening and will continue to happen, so speaking in this way is very damaging.”
Some in the African diaspora said Mr. Trump’s comments reflected common negative stereotypes about their homeland.
“We need to get over the misconception that everyone from a poor African country has been saved by staying in the U.S.,” said Moses Khisa, a Ugandan political scientist at North Carolina State University in Raleigh. He added: “I could well resign tomorrow and take up a position at Makerere University,” a pre-eminent institution in Uganda.
Mr. Trump’s State Department appears to have gone into damage-repair mode.
Without directly referring to the contentious statement, the State Department’s main Africa account said on Twitter that “the United States will continue to robustly, enthusiastically and forcefully engage in Africa, promoting this vital relationship, and to listen and build on the trust and views we share with our African partners.” The tweet was framed as a comment on a meeting of African ministers that the department hosted in November.
Not everyone accepted that gesture, and some people feared speaking in opposition to what they perceived as American policy. In Dakar, diners at a beachside restaurant that serves Moscow mules and mojitos declined to express their views about Mr. Trump, fearing they might be denied visas to visit the United States.
Babacar Faye, a tailor in Dakar, had tuned his radio to another station Friday morning when discussion of Mr. Trump’s comments was aired. His remarks were not surprising, Mr. Faye said.
“White people in general don’t like black people,” he said. “They just pretend to like us but they don’t.”
Nanjala Nyabola, a Kenyan writer who graduated from Harvard Law School and spent time documenting the anti-pipeline protests at the Standing Rock reservation in South Dakota, said Mr. Trump’s comment reminded her of the sadder sides of the United States.
“I personally can’t help but remember articles about hookworm in Alabama, and H.I.V./AIDS in Washington, D.C.,” she said, from her home in Nairobi. “Then I recall my time in Standing Rock, and I think that we are all in a giant shithole but some of us are looking at the stars.”
But Phoebe Mutetsi, also in Kigali, Rwanda, said she wasn’t falling for it.
“Trump is a troll,” she said. “He is trolling the world. Don’t feed the troll.”