Somalia's President Sheikh Sharif Ahmed promised on Wednesday to rid the country of the Islamist militants who are fighting to overthrow his administration and blocking food aid to millions of people facing starvation.
Ahmed was speaking four days after al-Shebab pulled most of its forces out of the Somali capital amid signs of deepening rifts among its senior commanders.
"As long as they are in Somali territory, even an inch, I will not rest," Ahmed told a news conference after meeting Tanzanian President Jakaya Kikwete in Dar es Salaam.
"Our determination is to clear them out," he said.
Some regional allies have criticised Ahmed's failure to quash the insurgency and push through a new constitution designed to better spread political power among the country's powerful clans and regions.
Al-Shebab's four-year rebellion is the latest chapter in Somalia's two-decade long civil conflict, sparked by the overthrow of dictator Mohamed Siad Barre in 1991. The chaos on land has allowed piracy to flourish off the Horn of Africa's shores.
Al-Shebab said its retreat from Mogadishu was a tactical move, raising fears it will increasingly resort to al Qaeda-inspired attacks such as suicide bombings and assassinations.
A series of military offensives against al-Shebab in Mogadishu this year and a drying up of "taxes" extorted from traders in the capital and farmers in rural areas affected by drought have deepened the divisions among the rebel commanders.
One faction prefers a more nationalist Somali agenda and wants to impose a harsh Islamic programme on the nation. Another more international wing aims to promote Jihad (holy war) and forge closer ties with regional al Qaeda cells.
By pulling out of Mogadishu, the rebels may hope to spread thin the 9,000-strong African Union peacekeeping force that is propping up Ahmed's Western-backed administration.
"There is no doubt we need more troops (peacekeepers)," said Ahmed.
The United Nations has authorised a task force of up to 12,000 soldiers.
When asked whether political negotiations with moderate groups within al-Shebab were an option, Ahmed said: "Our understanding is that al-Shebab ... are not interested in peace, but we will pursue that path if the opportunity arises."
Rashid Abdi, a Somalia analyst with the International Crisis Group, said al-Shebab was now too divided for any meaningful negotiations to take place.
Tanzania announced on Wednesday it would donate 300 tonnes of maize to Somalia.