Somali militant group al-Shabab said on Wednesday that they had launched a deadly attack on an upscale Kenyan hotel and business complex because of U.S. President Donald Trump's decision to recognize Jerusalem as the Israeli capital.

To really understand Israel and the Middle East - subscribe to Haaretz

The two page statement said: "The Mujahideen (holy warriors) carried out this operation ... (as) a response to the witless remarks of U.S. president, Donald Trump, and his declaration of Al-Quds (Jerusalem) as the capital of Israel."

An American who survived the 9/11 attacks, two best friends from Kenya who worked to help Somalia, and a British development professional were among the 21 people killed after Somali militants blasted their way into the hotel and office complex.

Nairobi is a major hub for expatriates and the compound targeted contained offices of various international companies, in an echo of a deadly 2013 assault on a Nairobi shopping center in the same neighborhood.

Kenya has often been targeted by Shabab, which killed 67 people at the Westgate shopping center in 2013 and nearly 150 students at Garissa University in 2015. The group says its attacks are revenge for Kenyan troops stationed inside Somalia, which has been riven by civil war since 1991.