Residents said civilians including women and children were among the casualties on Saturday when heavy fighting over territory broke out between men loyal to Mogadishu's Islamic courts and a local commander in the south of the capital.
Each side blamed the other for the hostilities, which highlight general lawlessness in the Horn of Africa country that has been without a functioning central government for the past 15 years and is run by various clan-based militias.
Residents said the fighting started early on Saturday and continued through the day. Many residents fled the area. As night fell, sporadic shooting could still be heard.
Commander Abdi Nurre Siyad said: "They came here to ignite a new crisis, and we are ready to defend our areas."
Shaikh Shariff Ahmed, who heads the influential Islamic court administration, confirmed the fighting and accused the Siyad of being behind it.
Among the dead, at least four were civilians, residents said. Hospital officials in the capital said 41 wounded were brought in, including seven children and 12 women.
One stray mortar hit a house and seriously wounded two children, witnesses said. Another mortar killed a woman.
Fighting among Somalia's myriad of clans and sub-clans has been common since local commanders overthrew former president Mohamed Siad Barre in 1991 and took over the nation of about 10 million.
An interim government was formed in 2004, but has proved fragile and fractious. It has been unable to rein in the powerful leaders and their militias.