Pro-Somali government forces have seized the town of Bulo Hawo on the border with Kenya and Ethiopia from the hardline Islamist group al-Shabab.
This is seen as a significant victory for the weak, UN-backed government against the al-Qaeda-linked militants.
Al-Shabab and their allies control most of southern and central Somalia but pro-government forces have been gaining ground in recent weeks.
Kenya has responded by boosting security along the border.
Black flag lowered
On Monday, pro-Somali government forces said they had carried out a controlled explosion of a huge roadside bomb in Bulo Hawo.
They have also imposed a curfew in the town.
The BBC's Bashkas Jugsodaay in northern Kenya says many people fled the fighting into Kenya.
He says they have not come as refugees but are staying with relatives until the situation is calm.
They have mostly gone to the Kenyan town of Mandera, just 3km (two miles) from Bulo Hawo.
Somalia's government says 11 al-Shabab fighters and one government soldier were killed in Sunday's fighting.
It says the militants' black flag was replaced with the blue and white Somali national one on all government buildings.
The moderate Islamist group, Ahlu Sunnah Wal Jama, helped government forces against al-Shabab.
There has also been fighting around the town of Beledweyne, north-east of Bulo Hawo.
Beledweyne is controlled by al-Shabab but government forces have advanced to within 20km (13 miles).
The government has this month seized several parts of the capital, Mogadishu, from al-Shabab, with the help of African Union peacekeepers.