The toll from an attack carried out by al-Shabaab terror group here early on Thursday rose to at least 25 people killed, in addition to 21 who were wounded, the police said.
The attack took place in a restaurant where dozens of hostages were held for several hours, Efe news reported.
Somali security forces put an end to the hostage situation after a suicide bomber rammed a car packed with explosives into the Posh Hotel, after Ramadan fasting was over and the streets were crowded.
The military surrounded the building and after an intense exchange of fire they killed the five attackers, which allowed them to take control of the restaurant and free 20 hostages.
The assault was claimed by al-Shabaab terror group, which in recent months has carried out numerous attacks on hotels and restaurants in the capital, killing dozens of civilians.
The militia has opted for a direct confrontation strategy and has also launched several attacks against the military bases of the African Union Mission in Somalia, killing hundreds of soldiers.
Militant group al-Shabaab, who five years ago pledged allegiance to al-Qaida, claimed to have killed 61 Somali government troops in a strike last week on an outpost in the northeastern region of Puntland, though the military put the number of slain soldiers at 30.
Thursday's attack was the first targeting civilians in Mogadishu since the start of the Muslim holy month of Ramadan.
Seven people died in a May 8 car bombing at another restaurant in the capital.
In April, the Somali government declared a nationwide "state of war" with the aim of destroying al-Shabaab, which still controls substantial areas of the nation's central and southern regions.