Fighting in Somalia's capital, Mogadishu, has killed at least 21 people as Ethiopian troops continue their withdrawal.

Witnesses say Islamist insurgents fired mortar rounds at the presidential palace Wednesday, prompting return fire from government forces.

Insurgents also attacked Ethiopian troops on a street near the palace, setting off a gunbattle.

Residents say around 50 people were wounded in the fighting.

Ethiopian troops who began withdrawing from the Somali capital on Monday vacated at least two more bases Wednesday, including a major base at Mogadishu Stadium.  The Ethiopians still control several bases in the city.

The pullout has raised fears of increased fighting among insurgent groups, although some Somalis hope the removal of foreign forces will lead to a unified government. 

Ethiopia sent thousands of troops into Somalia in late 2006 to help the Somali government oust an Islamist movement that had seized power in Mogadishu and other cities.

The offensive succeeded but sparked a two-year Islamist insurgency that has killed thousands and displaced more than a million Somalis.

Ethiopia has said it will withdraw its troops by the end of this week, following an October peace deal between the Somali government and a moderate Islamist group.

Hard-line insurgents led by the militant group al-Shabab have vowed to continue fighting, and now control many towns across southern and central Somalia.

Some information for this report was provided by AP and Reuters.