Municipal ambulance service chief Ali Muse said Sunday his medical staff collected most of the dead and wounded from areas near the city's main Bakara market.
Witnesses say the shelling erupted late Sunday after insurgents launched mortar attacks towards the presidential palace. African Union troops protecting the building responded with heavy artillery.
The violence is part of a three-year Islamist insurgency that has threatened to topple the fragile, U.N.-backed, Somali government.
A spokeswoman for the United Nations Human Rights Commission (Melissa Fleming) said earlier this month that more than 100,000 people have been displaced from the capital region this year after they fled the fighting.
For months, the transitional government has promised to launch a major offensive against insurgents who control large parts of Mogadishu and central and south Somalia.
The most prominent rebel group, al-Shabab, wants to topple the government and impose a harsh version of Islamic law on the country.
Somalia has not had a stable central government since 1991.