The country's deputy prime minister was also among those wounded by the bombings at the Central Hotel near the presidential palace, police official Capt. Mohammed Hussein said.
Al-Shabab, an Islamic insurgent group, claimed the responsibility for the attack, according to the group's radio station, Andulus.
Omar Ali Nor and Mogadishu's deputy mayor Mohamed Aden are among the dead, said lawmaker Mohamed Ali, who could not give an exact death toll.
"A dark day for our country, the death toll is even much higher than that," Ali said.
Two bloodied bodies were lying outside the hotel in central Mogadishu, as soldiers cordoned off the area and fired bullets into the air to disperse approaching crowds.
Deputy Prime Minister Mohamed Omar Arte was rushed to a hospital, and was among several other high-ranking government officials at the hotel at the time of the attack, Hussein said.
Somalia's president Hassan Sheikh Mohamud condemned the attack on the hotel, saying it would not derail efforts by his government to restore peace to Somalia which is recovering from decades of war.
"We shall continue the anti-terrorism war, this attack makes clear that terrorists don't have any respect for the peaceful religion of Islam by killing innocent Muslims." he said in a statement issued after the attack.
This is the second attack on a hotel in Mogadishu in less than a month. On Jan. 22, three Somali nationals were killed when a suicide car bomber blew himself up at the gate of a hotel housing the advance party of the Turkish President Recep Tayyip Erdogan who visited the country days later.
Despite major setbacks in 2014, al-Shabab continues to wage a deadly insurgency against Somalia's government and remains a threat in Somalia and the East African region. The group has carried out many attacks in Somaliaand in neighboring countries, including Kenya, whose armies are part of the African Union troops bolsteringSomalia's weak U.N.- backed government.
Al-Shabab controlled much of Mogadishu during the years 2007 to 2011, but was pushed out of Somalia's capital and other major cities by African Union forces.
Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.