In a separate attack, at least two soldiers were killed when a roadside bomb, planted by Al Shabab, struck a car carrying government troops in Central Shabelle outside of the capital.
The death toll of the Al Shabab-claimed car bomb and gun attack on a busy hotel and adjacent restaurant in the Somali capital reached 19 on Thursday, a police officer said on Thursday.
In a separate incident later in the day, at least two soldiers were killed when a roadside bomb, planted by Al Shabab, struck a car carrying government troops in Central Shabelle outside the capital, the military said.
In the Wednesday evening attack, a car driven by a suicide bomber rammed into the Posh Hotel in south Mogadishu before gunmen rushed into Pizza House, an adjacent restaurant, and took 20 people hostage. Posh Hotel is the only venue with a discotheque in the capital.
District police chief Abdi Bashir said Somali security forces took back control of the restaurant at midnight after the gunmen had held hostages inside for several hours. Five of the gunmen were killed, Bashir said.
"We are in control of the hotel but it was mostly destroyed by the suicide bomber," he said.
Ahmed Mohamud Adow, the spokesman for the country's interior ministry, said the dead included a Syrian national who worked at the restaurant. He did not identify the dead Syrian who local residents said worked as a chef at Pizza House.
Another 27 civilians were taken to hospital with various injuries, ambulance services said. Witnesses said the attack was launched after the iftar dinner for customers who were fasting for Ramadan. Most were still inside relaxing.
The wreckage of three-wheeled scooters caught up in the blast at the hotel, which also housed a massage parlour, lay overturned around the scene.
An ongoing conflict
Al Shabab claimed responsibility for the attack. The group claimed on Thursday morning it killed more than 20 people, including soldiers and government workers, but the group usually provides a higher death toll from its attacks than the government's figures.
The group has carried out a campaign of suicide bombings in its bid to topple the Somali government and impose its strict interpretation of Islam.
The Horn of Africa country has been racked by armed conflict since 1991, when clan-based warlords overthrew dictator Siad Barre and then turned on each other.
President Mohamed Abdullahi Mohamed, who was elected into office earlier this year, promised to defeat al Shabab.