"Nine people including two Shabaab gunmen were killed in the attack" yesterday, Mogadishu city spokesman Abdifatah Halane told AFP.
Al-Qaeda linked Shabaab jihadists attacked the Banadir Beach Restaurant close to the city's Lido Beach, setting off a car bomb before exchanging fire with security forces.
The restaurant is popular with young people and government officials. Around 20 people managed to escape from the restaurant during the gunfight.
By this morning officials said the attackers had been killed.
More From This Section
"The terrorist attack killed nine persons, five of them were civilians, two security forces and the other two were the militants who carried out the attack," Bishaar said, adding that two other civilians were injured.
It is the second time this year the group has attacked the Lido beach area and its many eateries, including upmarket establishments popular with business people and diaspora Somalis who have returned home to the city.
The group is expected to try and violently disrupt elections due to be held in September and October.
Despite abandoning the capital five years ago Shabaab still launches regular attacks against government, military, civilian and foreign targets.
The jihadists have also staged repeated attacks in neighbouring Kenya and a recent security analysis warned the group was expanding its horizons with cells active in Djibouti, Ethiopia, Kenya, Tanzania and Uganda as well as Somalia.