Somalia's capital sees near-daily bloodshed as anti-government fighters with suspected links to al-Qaeda try to overthrow the fragile government and push out 5,000 African Union peacekeepers.
Somalia's prime minister, in the UK, on Wednesday said al-Qaeda was using Somalia to train, regroup and plan furhter attacks across the region.
"Somalia has now clearly become a haven for the pariah that is al-Qaeda," Omar Abdirashid Sharmarke said in a speech in London.
"We cannot be certain of the precise size of their presence in our country, but al-Qaeda are here, they are training and planning in our land.
"Somalia is serving as an ideal place for them to re-group and redeploy."
Al-Shabaab and allied fighters control large parts of southern and central Somalia, and Sharmarke said defeating them was important not only to his country but "to the whole world".
"Somalia does risk being taken over by al-Qaeda, just as Afghanistan was the haven of al-Qaeda in the 1990s," he told the Royal Institute of International Affairs think-tank at Chatham House in London.
Sharmarke is part of a Western-backed transitional government headed by Ahmed that took over earlier this year, but has faced a renewed campaign by al-Shabab.
"An insurgency needs chaos, discontent and poverty and we must take that away," Sharmarke said.