"I jumped out through a window, like many others who survived in this way. Finally when they run out of bullets and the hotel was under siege by government soldiers, the two men had only one option, to blow themselves up."

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.

At least 40 people were killed and more than 100 injured in the violence that followed, medics and witnesses said.

Sheikh Ali Mohamoud Rage, al-Shabab's spokesman, 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.

Hundreds of new peacekeepers, mostly Ugandan, have arrived in the last days to help the government in its battle against al-Shabab.

The force has so far been able to do little more than guard the airport and port and shield Sharif Ahmed, the president.

Somalia's members of parliament, the apparent targets of Tuesday's attack, do not benefit from this protection.

"We have the same enemies ... and I don't know why the MPs don't have the same security," Abdiladif Muse Sanyare, a pro-government legislator, said.

He was speaking from Nairobi, where many of the MPs say they have to live to feel safe.

Ugandan reinforcements

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.

"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.

Al-Shabab, which has been fighting Somalia's government since 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 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.

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 Afyare 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."