Violence in Mogadishu killed at least 24 people on Wednesday, and thousands of Somalis fled the capital fearing a government offensive against fighters.
Al Shabaab fighters fired mortar shells at the Villa Somalia presidential palace, prompting African Union (AU) guards to respond with a deafening barrage of artillery. At least 16 people died in the bombardment, medical officials said.
"The death toll may rise because we have not yet reached some of the districts where shells also landed," Ali Muse, coordinator of the city's ambulance service, told Reuters.
A nurse at Medina Hospital said at least 40 wounded people had been rushed there, five of whom died of their injuries.
Separately, a gun battle after an argument between police and soldiers at the Mogadishu police academy killed eight people. Witnesses said at least one civilian also died in the crossfire.
Witnesses said thousands of residents were leaving the bomb-shattered capital, fearing the start of a government offensive that has been threatened for weeks.
Farhiya Ismael, a mother-of-six, fled north Mogadishu's Livestock Market district for nearby Elasha two days ago.
She said many fighters from the al Shabaab had entered the capital from one of their bases in the southern port of Kismayu.
"Now it is time to flee this area again," she told Reuters by telephone. "Last night, AMISOM (AU peacekeepers) shelled the al Shabaab members who had just passed us here and we could not sleep because of panic from the shells."
PHOTO CAPTION
Residents carry a man wounded in mortar shelling at Bakara market in Somalia's capital Mogadishu, February 10, 2010.
Agencies