Somalia has seen a surge in fighting, despite a ceasefire pact last month
Insurgents and Ethiopia-backed Somali government troops have exchanged heavy artillery fire in Mogadishu.
Both sides claimed to have won the battle, fought with mortars and rocket-propelled grenades, inflicting high casualties on the other.
Witnesses in the capital say at least four civilians were killed when a mortar hit their house.
Years of conflict and drought have left more than half of Somalia's population needing food aid.
But aid workers have also been targeted recently and pirates have made it difficult to deliver food aid to the country.
The BBC's Mohammed Olad Hassan in Mogadishu says the clashes began when Islamist insurgents attacked a government base.
An Islamist spokesman told the BBC that more than 10 Ethiopian and government troops had been killed.
He admitted that two Islamists had been killed.
An army colonel said 21 insurgents had been killed and an armed truck captured but did not give his own side's casualty figures.
There is no independent report of the casualties.
A ceasefire was signed last month between the government and one Islamist leader but the violence has continued.
Ethiopia sent troops into Somalia in 2006 to help government forces oust Islamists who had taken control of Mogadishu and much of southern Somalia.