The fighters briefly occupied a police station in south Mogadishu, before heading back out of the area, chanting "God is great," locals said.
Tahir Mohammed Mahmoud, an administrative assistant, said at least 35 people were undergoing treatment at Mogadishu's Medina Hospital from injuries suffered during the fighting, including some who were seriously wounded.
He said it was the worst fighting, and heaviest day for hospital admissions, for at least four months in the city.
Another witness to the fighting, Hassan Hussein, said he had seen two dead Ethiopian soldiers. Ethiopian officials were not immediately available for confirmation.
The latest fighting comes as political divisions between Somalia's president and its prime minister threaten to split the fledgling administration.
Abdullahi Yusuf, the president and Ali Mohamed Gedi, the prime minister, have feuded almost from the moment they came to power in late 2004 after peace talks in Kenya.
But their rift widened earlier this year as the two men backed different concerns, with both hoping to exploit their country's potential oil resources.
Somalia's fragile government has faced an Iraq-style conflict with roadside bombings, assassinations and suicide attacks since it routed the Islamic courts movement in January with the help of Ethiopia's military.