The first car bomb explosion took place outside Nasa-Hablod hotel, close to the presidential palace, on Saturday.
Minutes later, gunfire was heard from inside the hotel, followed by another car bomb explosion close to the former parliament house.
A senior Somali police officer, a former lawmaker and civilians were among those killed in the two blasts.
A third explosion was also heard after an attacker detonated his explosive vest.
The al-Shabab Takfiri terrorist group immediately claimed responsibility for the attacks, saying its militants were inside the hotel.
As night fell, sporadic gunfire could still be heard around the hotel, which is frequented by politicians and many Somali elites.
Similar to previous al-Shabab attacks, witnesses said the militants disguised themselves by wearing military uniforms.
On October 14, a truck bombing in Mogadishu killed nearly 360 people, and left hundreds injured. Almost all those killed in the bombing were civilians.
Following the truck bombing, Somalia’s President Mohamed Abdullahi Mohamed visited regional countries to seek more support for the fight against al-Shabab, vowing a "state of war."
A 22,000-strong multinational African Union force in Somalia is expected to pull out and hand over the country's security to the Somali military by the end of 2020.
Government forces have been battling al-Shabab since 2006. The militants controlled Mogadishu between 2007 and 2011, when they were driven out of the capital with help from African Union troops. A period of relative calm started in Mogadishu afterward. However, since last month, the group seems to have resumed its attacks in the capital.
The extremist group is only one of the challenges facing the new Somali government, which is still struggling to expand its authority beyond the capital and other selected areas.