Advances by the al Qaeda affiliate, which included briefly capturing villages within 50 km of Mogadishu last month, have left residents of the capital on edge amid rumours al Shabaab could target the city.
The outcome of the battle was not immediately clear, with government forces and al Shabaab giving conflicting accounts.
Captain Hussein Olow, a Military Officer in Adan Yabaal, told Reuters that government troops had pushed back the militants.
Al Shabaab, which has waged an insurgency since 2007 to seize power and rule based on its strict interpretation of Islamic Sharia law, said in a statement that its forces had overrun 10 military installations and captured the town.
National government officials did not immediately respond to requests for comment.
The fighting comes as the future of international security support to Somalia has grown increasingly precarious.
A new African Union peacekeeping mission replaced a larger force at the start of the year, but its funding is uncertain, with the United States opposed to a plan to transition to a United Nations financing model.
--Reuters--