Somali government forces backed by troops of the African Union Mission in Somalia (AMISOM) have fought bloody battles in the capital Mogadishu with the Al Qaeda-inspired Shebab rebels who want to topple the administration.
"All sides have used artillery in the capital Mogadishu in an unlawful manner that has caused civilian casualties," Human Rights Watch said Monday in a report.
"Al-Shebab has fired mortars indiscriminately from densely populated areas and the TFG (government) and AMISOM forces have often responded in kind with indiscriminate counterattacks.
"As a result, civilians have not known where to turn for protection," the New York-based watchdog added.
The Shebab withdrew from Mogadishu on August 6, saying it was a tactical move, which many fear implies resorting to suicide attacks after the insurgents vowed to continue combating the Western-backed government.
The violence in Mogadishu has hampered the distribution of aid to tens of thousands of people facing famine after fleeing to the city to escape a harsh drought in other parts of the country.
Somali government spokesman Abdirahman Omar Osman denied the rights group's accusations.
"We refute these allegations and the government is willing to meet with Human Rights Watch officials to discuss their concerns," he said in a statement.
"Reliable figures are hard to come by in Somalia which clearly shows that the information they have lacks credibility," he added. "On the other hand, Al-Shebab is responsible for most of human rights violations that happen in Somalia."
The 9,000-strong AU force has also in the past denied accusations of indiscriminate shelling.