The group said in a statement picked up by SITE that its fighters stormed the DusitD2 complex on instructions by Al-Qaeda leader Ayman al-Zawahiri.
“It is a response to the witless remarks of the US president, Donald Trump, and his declaration of Al-Quds (Jerusalem) as the capital of Israel.”
The assault with guns and explosives claimed the lives of 14 people as it unfolded Tuesday in the complex, which includes a 101-room hotel, spa, restaurant and offices.
All five of the assailants were killed before an operation by rescue forces to rescue trapped civilians and clear buildings ended 20 hours later.
The Al-Shabaab statement was entitled: “Al-Quds (Jerusalem) will never be judaized,” according to SITE.
“Know that we will hold you to account for every Muslim blood spilt in Palestine; ounce for ounce,” it said in part.