Somali government troops backed by African Union forces have captured a key stronghold of al-Shabab Islamists, local officials say.
The regional governor told the BBC that he was in the centre of Barawe, about 200km (125 miles) south of Mogadishu.
The AU says al-Shabab, who had held the town for six years, used it as a base to launch attacks on the capital.
Residents said many of the al-Qaeda-aligned militants had begun withdrawing from the key port town on Friday.
"The situation is calm, the militiamen had fled before the forces reached the town," regional governor Abdukadir Mohamed Nur said.
Al-Shabab has lost control of several towns in the past month, but still controls large swathes of territory in rural areas.
The BBC's Emmanuel Igunza says the news is a significant blow to al-Shabab because they had used Barawe as a supply route for weapons and food and as a base for a lucrative charcoal business.
The group, which is estimated to have at least 5,000 fighters, wants to overthrow the UN-backed Somali government and has imposed a strict version of Sharia in areas under its control.
Last week, a woman was stoned to death in Barawe for alleged adultery.
Correspondents say al-Shabab tends to tactically withdraw from areas when faced with a large offensive, but leaves some fighters within the civilian population to launch attacks later.