Eight parliamentarians were killed in the attack.
"It happened when two suicide bombers detonated themselves," Abdirahman Yariisow, Somalia's information minister, who was at the hotel, told Al Jazeera.
"The security was there, but for some reason, they managed their way in and started shooting. No one was expecting this kind of atrocity.
"This shows how al-Shabab is brutal; they never respected our call [to stop the fighting] for the holy month of Ramadan."
The attack came after al-Shabab fighters declared a "massive, final" war against what they called "invaders" and attacked army barracks in several districts of Mogadishu on Monday.
Sheikh Ali Mohamoud Rage, al-Shabab's spokesman, then said fighters were starting a new war against "invaders", an apparent reference to the 6,000 African Union troops deployed in the country to support government forces.
At least 40 people were killed and more than 100 injured in the violence that followed, medics and witnesses said.
There was an overnight lull before the fighting resumed on Tuesday morning.
The fighting came days after hundreds of Ugandan troops began arriving in the Somali capital to strengthen the current AU peacekeeping force.
"As long as these [AU] forces are in Mogadishu, I think it will be unlikely for al-Shabab to take over [the city]. But they can inflict huge damage," Dr Afyare Abdi Elmi, a professor of International Affairs at Qatar University, told Al Jazeera.
Uganda said last month that it was willing to send 1,200 troops to Somalia, in addition to the 6,000 strong AMISOM mission sent by African Union countries.
"The additional troops began arriving last Friday. They were airlifted to different areas and of course they will continue to arrive," Wafula Wamunyinyi, the AU deputy special representative for Somalia, said on Monday.
Al-Shabab, which has been fighting Somalia's UN-backed government since the start of 2007, recently claimed responsibility for a twin bombing attack in Uganda, which killed more than 70 people who were watching the World Cup.
The group has said that it will continue to undertake strikes in Uganda and Burundi, in east-central Africa, as long as those countries provide troops for the AU peacekeeping force in Somalia.
Somalia has not had an effective central government for nearly 20 years and al-Shabab controls significant portions of the country.
The US and other countries say al-Shabab is linked to al-Qaeda and consider the group a terrorist organisation.
More than 21,000 Somalis have been killed in fighting since the start of the uprising, 1.5 million have been uprooted from their homes and nearly half a million are sheltering in other countries in the region.
"Civil wars end either through military victory or through a negotiated settlement," Dr Abdi Elmi said.
"In Somalia, at least for the short term, neither is likely to happen ... the goals of the opposing forces cannot be reconciled now," he said.
"In the long run, building effective Somali security forces and functioning state is the answer."