Somali government forces have remained in control of Qoryoley town in Lower Shabelle region after al Shabaab militants stormed an army base there on Tuesday night.
The ambush has sparked a heavy clash between the militants and SNA troops in which an unspecified number of people died, the military said.
Local residents reported a fierce gunfight flared up following Al Shabaab raid on army barracks. The sides exchanged small and heavy weaponry that could be heard from a distance.
The fighting had ended and that the militants had left the town, they said.
Details of the casualties were not immediately known as the military commanders in the region have not released any statement regarding the last night attack in Qoryoley.
The town has held by Al Shabaab for almost seven years before Somali and AMISOM retake control of the town from the militant group in 2014 after the offensive.