Conflict in Somalia has killed nearly 6,000 civilians in Mogadishu this year and forced some 720,000 others from their homes, according to a local human rights group.
The United Nations says Somalia's humanitarian crisis is the worst in Africa and has appealed for $406 million in aid.
Fighters have been repeatedly clashing with the interim government and its Ethiopian military allies since the Islamic Courts and its allies were forced from the capital a year ago in a short war.
Before the attack, Sheik Qasim Ibrahim Nur, the director of security at the national security ministry, said the government has "no power to resist the Islamists" and was failing to control most of the country.
"About 80 per cent of Somalia is not safe and is not under control of the government," Nur told the AP news agency.
Nur also appealed for international support, saying the Islamists "are everywhere".
Witnesses said the fighters attacked several neighbourhoods in north and south Mogadishu in the early hours of Thursday, but there were no immediate reports of fatalities.