Two militia groups are responsible for Mogadishu's worst gun battles in over a decade,
Ibrahim Maalim, a militia member close to Somalia's internal security minister Mohamed Qanyare, said seven people had been killed and 20 people wounded in fighting between the Islamic courts militia and a warlord alliance in the Siisii area.
That adds to five deaths and 12 wounded in overnight fighting already reported earlier in the day.
Ali Nur, a member of the warlord alliance, said fighting resumed in the afternoon after an overnight clash in the same area. Nur said he expected the death toll to rise since the combatants were firing mortars, anti-aircraft missiles and other heavy machine guns at each other from close range.
"I can see the mortars and missiles the militias are firing," Nur told Reuters by phone from Mogadishu. "The death toll will rise because some of the mortars are falling on buildings nearly five kilometres away."
The renewed hostilities ended a nearly week-long ceasefire brokered by local elders. The two rival groups last fought on May 17 outside the battle-scarred city when the Islamic courts militia ambushed a village controlled by Mohamed Dheere, a member of the warlords' coalition, and killed five of his men.
The same two militias have been locked in fierce battles that have killed more than 250 people since February. Analysts view the fighting as a proxy war between Washington and Islamic militants.
The United States considers anarchic Somalia, without an effective government since former dictator Mohamed Siad Barre was ousted in 1991, a sanctuary for al-Qaeda in east Africa.
