The Somali military, backed by the African Union (AU), has retaken Merca from al-Shabab militants who seized the port city on Friday, residents say.
Civilian casualties were reported after what residents said was light resistance from the militants.
The AU on Friday denied on Friday it has lost control of Merca, saying it had made a tactical withdrawal.
Al-Shabab was forced out of the capital Mogadishu in 2011 but still has a presence in large areas of the south.
A Somali military official told AFP news agency: “The Somali forces and Amisom [AU] peacekeepers secured control of Merca again and now the situation has returned to normal.
“There was brief exchange of gunfire, but the militants have fled.”
He said “several” al-Shabab fighters and one Somali soldier had been killed in the fighting. A resident told AFP that four civilians had died in his area.
The fighting comes three weeks after al-Shabab overran an AU military base outside the southern Somali town of el-Ade, saying they had killed about 100 Kenyans soldiers.