The Friday attacks began when the terrorists detonated at least two car bombs near a security checkpoint close to a park known as the Peace Garden, killing two guards.
The militants then set off another car bomb about 30 minutes later before storming the SYL Hotel near the presidential palace, but their attempt to enter the building was thwarted by Somali security forces, officials said.
The hotel is reportedly popular with government authorities and foreign businessmen.
According to local authorities, four militants were killed in the attacks, for which the al-Qaeda-linked group claimed responsibility.
The park targeted in the first bombings is particularly crowded on Fridays, which is a weekend holiday in Somalia, and most of the civilian casualties were caused there.
The development came a day after al-Shabab militants claimed responsibility for a mortar attack that killed at least three civilians and injured at least eight more in the capital. Mortars were reportedly fired at the presidential palace but they missed their target.
The Somali capital has been plagued by bloody terrorist attacks and bombings over the past decades.
In recent years, the city has struggled to achieve some degree of stability by attracting millions of dollars in foreign investments, which has helped build a number of hotels, restaurants and shops.
The al-Shabab terrorist campaign in the country, however, has not diminished. Car bombings and assassinations across Somalia continue by the militants as many of the largest hotels have been bombed; Press TV reported.
218-12