The bloodshed began when a car packed with explosives blew up near the main gate of the high-profile Central Hotel, which is a few miles from Somalia's presidential palace, Mogadishu police Capt. Hassan Abdi told CNN.
The explosion was followed by heavy gunfire between the attackers and hotel guards, witnesses said. Then came a second blast -- a suicide bombing carried out by a woman near a mosque inside the hotel -- as other attackers shot their way in, Abdi said.
"I saw ... several people burned by the flames of the explosions lying on the blood-filled ground inside the hotel," said Mustaf Mohamed, who runs a small shop nearby.
Government ministers, members of Parliament, army officers and other officials often go to the Central Hotel. Deputy Prime Minister Mohamed Omar Arte was among those inside at the time of the attack, having just attended traditional Friday prayers there.
He suffered minor injuries but survived, according to state media, as did Transportation Minister Ali Jama Jangeli.
But other prominent politicians did not make it. They include Parliament members Hajji Gafe and Ali Omar, as well as Mohamed Aden Guled, Mogadishu's deputy mayor, Abdi said.
In addition to the dead, 20 others were wounded in the attack.
, an Islamist extremist group blamed for terrorist acts in Somalia and beyond over the years, claimed responsibility, Sheikh Abdiaziz Abu Musab, a spokesman, said on militant-run Andulus radio.
Villa Somalia, the East African country's equivalent of the U.S. White House, sharply condemned what it called "today's outrage."
The presidential palace tweeted, citing President Hassan Sheikh Mohamud, "#AlShabaab are un-Islamic and anti-democracy."
Al-Shabaab's history of terror
Since emerging in the mid-2000s, Al-Shabaab has been intent on taking control of Somalia
, one of the world's poorest countries, with a gross domestic product per person that ranks 226th out of 228 countries
. Its militants have repeatedly targeted Somali officials, soldiers and institutions in the East African nation.
The group's focus has broadened, especially since then-leader Ahmed Godane
announced in 2012 that his followers "will march with (al Qaeda) as loyal soldiers."
The following year, Al-Shabaab carried out its most high-profile operation yet at the upscale Westgate Mall in Nairobi, Kenya. Shoppers were gunned down, held hostage and tortured. Four days later, the siege ended with as many as 67 dead and parts of the mall destroyed.
Al-Shabaab has never forgotten its home base of Somalia.
The Somali government, helped by allies including the United States and African Union, has managed to strike significant blows against the group, including a 2014 U.S. operation that killed Godane
But Al-Shabaab has continued its campaign of violence in attacks such as a suicide blast last month on a Somali army convoy
in Mogadishu, the bombing of a bus carrying Kenyan teachers in Galkayo, Somalia, and an attack on an African Union military base