Islamic insurgents attacked a peacekeeping base in the Somali capital for the second time in a week on Tuesday, and clashes between the soldiers and militants left at least 18 people dead throughout the city.
Dozens of others, including women and children, were seriously injured in Tuesday's fighting, which came two days after a suicide bomber attacked an African Union peacekeeping base, killing 11 Burundian soldiers.
An extremist Islamic group called al-Shabab, which claims the AU troops are an occupying force and has threatened them, has claimed responsibility for Sunday's attack.
The U.S. State Department considers al-Shabab a terrorist organization linked to al-Qaida, something the group has denied.
On Tuesday, Mogadishu's ambulance service staff collected the 18 bodies from different parts of the capital, said Rufa'i Mohamed Salad, one of the coordinators.
Medina Hospital Director Dahir Mohamed Dhere said 78 people injured in the fighting were admitted to his hospital. Many were seriously injured and some were women and children.
Witnesses said the fighting started earlier in the day when Islamic insurgents attacked a military base in southern Mogadishu where there were government soldiers and African Union peacekeepers. Both sides fired rounds of mortars at each other and exchanged machine gun fire, said Abdifitah Mohamed, who lives near the base that was attacked.
The insurgents also fired mortar rounds at the presidential palace but most landed outside the compound, said presidential spokesman Abdullahi Khadar. On Monday, President Sheik Sharif Sheik Ahmed had returned to Mogadishu with his Cabinet from Djibouti, where Somali lawmakers had elected Ahmed.
"The president is here and he is safe," said Khadar.
Somalia has not had an effective government since 1991 when warlords overthrew dictator Mohamed Siad Barre. They then turned on each other, plunging the Horn of Africa nation of 7 million to anarchy and chaos.
The weak government Ahmed took over in January controls virtually no territory and is struggling to prove its legitimacy, though Ahmed has been welcomed by influential Islamic clerics in this predominantly Muslim country.
African Union peacekeepers have a restricted mandate to guard key government installations in Mogadishu. Until now, they have not been involved in fighting Islamic militants in the capital during battles that have killed thousands of civilians over the past two years.