Six civilians were killed and 10 injured after al-Shabab militants attacked a beachfront hotel in the Somali capital, Mogadishu, police said.
Security forces rescued more than 80 guests from the Pearl Beach hotel after a six-hour siege on Friday night.
Three members of the security forces died during the rescue operation and were commended for their bravery.
All of the attackers were killed in a fierce gunfight with security forces, police said.
The Pearl Beach Hotel was popular with government officials.
These places are frequently targeted by al-Shabab insurgents, who have been fighting the Somali government for more than a decade and retain a grip on parts of the country.
People who were caught up in this latest attack described the shocking moment gunmen stormed the compound.
“I was sitting near the beach when the first explosion happened at the front door of the hotel and there was another one at the back,” eyewitness Hussein Saddam told the Reuters news agency.
“I saw four corpses – two were women and the other two were men… It was a very shocking scene but Allah saved me.”
The Pearl Beach hotel attack comes weeks after al-Shabab militants killed dozens of Ugandan soldiers, who were part of an African Union peacekeeping mission 110 km away ( 68 miles) south of the capital in the Lower Shabelle region.