Mahamud Hasan Mahamud, the mayor of Adan Yabal in Middle Shabelle region, said the army and militias had taken control of the town and the surrounding district of the same name without encountering resistance on Monday.
"When they entered the town, al Shabaab were not there," Absher Mudey, a shop owner in Adan Yabal, told Reuters by telephone. "Most of the people fled because they were afraid that fighting would break out."
"This district of Adan Yabal was very important for al Shabab because it is the heart that connects the central regions and the south of Somalia. It was also their main base from which they manage the central regions," Mahamud told Reuters late on Monday.
He said the troops were sweeping the town, which is around 240km northeast of the capital Mogadishu, for mines.
"Seizing this town was the best opportunity for Somali government & the biggest setback to the terrorist which lost many districts in the last 3 months," the prime minister's spokesman Abdifitah Hashi wrote on Twitter.
The government, backed by AU troops and clan militias, says it has killed around 700 members of al Shabab and recaptured scores of settlements as part of a months-long campaign to loosen the al Qaeda-linked group's control over large swathes of the country.
Al Shabaab frequently abandons areas before army offensives, but the government often fails to hold recaptured territory, analysts say, allowing the militants to return.
The head of the AU mission in Somalia, Mohammed El-Amine Souef, described the town as a training ground for al Shabab, and said the broader campaign was delivering "destructive and decisive" blows against the group.