The fighting Monday began when insurgents fired mortars at the presidential palace, Villa Somalia, sparking return fire from government troops and African Union peacekeepers.
Many of the mortars fell on homes in the Hodan and Hawlwaddag districts.
Ali Muse, the head of Mogadishu's ambulance service, told reporters that dozens more were injured in the fighting.
Somalia's transitional government has promised for months that it will launch a major offensive against the insurgents, who control large parts of the capital and central and southern Somalia. The offensive has yet to materialize.
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.