Somalia's al Shabaab group launched a suicide bomb attack on a hotel in the centre of Mogadishu on Saturday, killing at least 5 people, a police officer said.
"What we know is that there were at least five victims, including three security guards, and that six others were injured," police official Ibrahim Mohamed said.
The toll was later revised as at least 15, including guards at the site, civilians and militants. Others were wounded.
Major Ali Mohamed said the death toll included guards, civilians and militants. "The operation has now ended but we are still combing the building for any possible militants who are hiding," he told Reuters.
A spokesman for al Shabaab, which claimed responsibility, said the death toll was at least 20 guards and civilians.
The Shabaab group claimed responsibility for the attack in a statement distributed through the Telegram smartphone app.
The assault was led by a suicide attacker driving a car laden with explosives, the Shabaab said in a statement distributed through the Telegram smartphone app.
"They started with a suicide bomb and then stormed in. Now they are inside and the heavy exchange of gunfire continues," Major Nur Farah told Reuters.
He said Nasahablood hotel had been targeted.
The attack began at 4:30 pm (1330 GMT) with a powerful blast followed by heavy gunfire, an AFP journalist and a witness said.
At 7:00 pm, as night fell in Somalia, sporadic gunfire could still be heard, witnesses said.
The Naasa Hablood hotel in southern Mogadishu is often used by politicians and members of the Somali diaspora visiting the city.
Somali security forces cordoned off access to the neighbourhood in which the hotel is located, an AFP photographer said.
Saturday's attack came just three weeks after another assault quickly claimed by the Al-Qaeda-linked Shabaab group on the city's Ambassador hotel left 10 dead including two lawmakers when a huge car bomb ripped the front off the six-storey building.
Shabaab gunmen besieged the Ambassador hotel for more than 12 hours.
Muslims in Somalia and around the world are observing Ramadan. In previous years, al Shabaab has often intensified attacks during the fasting month, often picking targets where people gather just before or after breaking the fast.
Spike in violence
The Shabaab lost their foothold in the capital in 2011 but continue their battle to overthrow the Somali government and launch regular attacks on military, government and civilian targets like hotels and restaurants in Mogadishu and elsewhere.
In November last year, the extremists carried out a similar attack on the Sahafi hotel in central Mogadishu, leaving at least 12 dead.
Across the border in Kenya, five policemen were killed on Monday when suspected Shabaab fighters attacked their convoy.
Shabaab militants have staged repeated attacks in Kenya, including the killing of at least 67 people at Nairobi's Westgate Mall in 2013 and the massacre of 148 people at a university in Garissa in April 2015.
The Shabaab earlier this month confirmed the death in a special forces raid of a commander named Mohamed Mohamud aka Dulyadin, who was suspected of organising the Garissa University attack.
In recent months they have also claimed attacks on bases of the African Union peacekeeping mission in Somalia (AMISOM).
The authorities in Nairobi have vowed to send back 350,000 Somali refugees living in Dadaab camp in northeast Kenya.
The UN refugee agency however has called on Kenya to ensure the repatriation is carried out "in a humane, dignified manner, in line with international principles".
The vast majority of residents of the sprawling Dadaab complex of camps close to the Kenya-Somalia border fled Somalia's more than two-decades long conflict. Many remain fearful of returning to a country where insecurity remains rife and poverty is widespread.