At least 40 people were wounded in the late Friday night attack and security forces rescued many others, including children, from the scene at Mogadishu's popular Hayat Hotel, they said Saturday.
The attack started with explosions outside the hotel before the gunmen entered the building.
Somali forces were still trying to end the siege of the hotel almost 24 hours after the attack started. Gunfire could still be heard Saturday evening as security forces tried to contain the last gunmen thought to be holed up on the hotel’s top floor.
The Islamic extremist group al-Shabab, which has ties with al-Qaida, claimed responsibility for the attack, the latest of its frequent attempts to strike places visited by government officials.
The attack on the hotel is the first major terror incident in Mogadishu since Somalia's new leader, Hassan Sheikh Mohamud, took over in May.
In a Twitter post, the U.S. Embassy in Somalia said it “strongly condemns” the attack on the Hayat.
“We extend condolences to the families of loved ones killed, wish a full recovery to the injured, & pledge continued support for #Somalia to hold murderers accountable & build when others destroy,” it said.
There was no immediate word on the identities of the victims, but many are believed to be civilians.
Mohamed Abdirahman, director of Mogadishu’s Madina Hospital, told the AP that 40 people were admitted there with wounds or injuries from the attack. While nine were sent home after getting treatment, five are in critical condition in the ICU, he said.
“We were having tea near the hotel lobby when we heard the first blast, followed by gunfire. I immediately rushed toward hotel rooms on the ground floor and I locked the door,” witness Abdullahi Hussein said by phone. “The militants went straight upstairs and started shooting. I was inside the room until the security forces arrived and rescued me.”
He said on his way to safety he saw “several bodies lying on the ground outside hotel reception.”
Al-Shabab remains the most lethal Islamic extremist group in Africa.
The group has seized even more territory in recent years, taking advantage of rifts among Somali security personnel as well as disagreements between the government seat in Mogadishu and regional states. It remains the biggest threat to political stability in the volatile Horn of Africa nation.