A senior CNN executive has flown to Nairobi to apologise for coverage calling the country a “hotbed of terror” ahead of Barack Obama’s visit in July.

Many Kenyans were outraged by the report, which suggested Obama was likely to be attacked during his historic visit to the land of his father’s birth.

While the country has suffered a string of atrocities by the Somalia-based al-Shabaab militant group, most of Kenya does not resemble the parts of the world where terror attacks are commonplace, stressed Kenya’s active Twitter community.

The hashtag #someonetellcnn trended for several days ahead of the US president’s arrival, visit with users deploying a mix of humour and satire to criticise the American network.

Tony Maddox, a CNN executive vice president and managing director, said the channel could have covered the story differently.

“We acknowledge there is a widespread feeling that the report annoyed many, which is why we pulled down the report as soon as we noticed,” he said.

“It wasn’t a deliberate attempt to portray Kenya negatively, it is regrettable and we shouldn’t have done it. There is a world at war with extremists; we know what a hotbed of terror looks like, and Kenya isn’t one.”

Kenyan president Uhuru Kenyatta’s press team issued a statement with the headline CNN regrets ‘hotbed of terror’ gaffe, written in unusually triumphal terms. It said the president had expressed “his deep disappointment at the story” which had “angered the people of Kenya”.

“In one stroke, CNN’s description of Kenya as a ‘hotbed of terror’ undermined the sacrifices made by our Kenyan troops [in Somalia], and the value of hundreds of lives lost, and relegated them to nothing. That’s why Kenyans, as expressed by those on Twitter, were so angry. Kenya is nothing like the countries that have real war. There was no reason to portray Kenya in that way,” the president was quoted as telling the CNN executive.

The Kenya Tourism Board cancelled an advertising campaign it planned to run on CNN aimed at luring tourists back to the country following the story. Tourism is a key foreign exchange earner for Kenya but travel advisories and repeated Shabaab attacks have led to a downturn in recent years.

Kenya has one of the most vibrant media environments on the continent and its Twitter community has emerged in recent months as a major source of news with its frequent and vigorous online campaigns.

A recent target for its ire was the Rwandan president, Paul Kagame. His ill-tempered exchange with a Kenyan Twitter user who had urged him not to extend his stay in office spawned a hashtag #someonetellkagame, which was one of the top trending subjects in Kenya.