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.
Thousands of protesters gathered in Washington, D.C., and across the U.S. on Saturday, part of some 1,200 demonstrations that were expected to form the largest single day of protest against President Donald Trump and his billionaire ally Elon Musk.
Israel has detained two British members of parliament and refused entry to the officials who were visiting as part of a parliamentary delegation, British Foreign Minister David Lammy said in a statement late on Saturday.
Israeli occupation forces committed multiple massacres against families in the Gaza Strip over the past 24 hours, resulting in the killing of at least 60 Palestinians and the injury of 162 others, according to medical reports.
U.S. President Donald Trump fired General Timothy Haugh as director of the National Security Agency on Thursday, according to two officials familiar with the decision, and congressional Democrats denounced the removal of the nonpartisan official from a top security post.