At least 13 Somali troops have died after the army attacked militant group al Shabaab near the district of Afgoye northwest of the capital, Mogadishu, a military official said.
Al Shabaab has battled since 2008 to overthrow Somalia's internationally-recognised central government and establish its rule.
"We left Afgoye district and attacked al Shabaab in the farms outside Afgoye," Major Mohamed Ali told Reuters, describing Wednesday's incident in the district about 30 km from Mogadishu.
"We killed four militants and chased al Shabaab," Ali said late on Wednesday. "Most of the military came back and we left two dozen soldiers there. Then, this evening, al Shabaab attacked our few soldiers and killed 13."
Al Shabaab has claimed responsibility.
"We killed 24 soldiers and the rest escaped and ran away," said Abdiasis Abu Musab, the group's military operations spokesman.
Somalia's government and al Shabaab often give differing figures of casualties after attacks.
Deadly violence has engulfed Somalia since 1991, when clan warlords deposed leader Siad Barre and then turned on each other.
Canadian prosecutors have charged a 30-year-old Vancouver resident with murder for killing at least 11 people and injuring dozens after he rammed an SUV through a crowd at a Filipino community festival in the western Canadian city.
Qatar's prime minister said on Sunday that efforts to reach a new ceasefire in Gaza have made some progress but an agreement between Israel and Hamas to end the war remains elusive.
A huge blast most likely caused by the explosion of chemical materials killed at least 18 people and injured more than 700 on Saturday at Iran's biggest port, Bandar Abbas, Iranian state media reported.
The UN Refugee Agency (UNHCR) and the UN Office for the Coordination of Humanitarian Affairs (OCHA) have sounded the alarm over severe funding shortfalls that are hindering life-saving humanitarian aid in countries including Nigeria, Burundi, and Colombia.