MOGADISHU — Somalia's Islamist Shebab rebels pulled out of key positions in the war-torn and famine-struck capital on Saturday, with the country's president proclaiming the city "fully liberated."
"Mogadishu has been fully liberated from the enemy, and the rest of the country will soon be liberated too," Sharif Sheikh Ahmed told reporters.
The Al-Qaeda affiliated Shebab insurgents abandoned several strategic positions overnight that were then taken over by government troops.
"We are very happy -- the fruits of bloodshed and the wars that we fought against the rebels are finally attained," Ahmed said.
African Union-backed government troops have been battling Shebab rebels in Mogadishu in an offensive to secure aid delivery routes for victims of the drought threatening some 12 million people in Somalia and other Horn of Africa countries.
"We have two enemies to fight - one of them is the Shebab, while the other is those who try to rob the people," the president said.
"We will not tolerate looting, and anyone found committing such a crime will be brought to justice."
Lawless Somalia is awash with rival militia factions. On Friday, food aid being handed out to famine victims in Mogadishu was looted by gunmen, who killed five people.
However, a spokesman for hardline rebels, Ali Mohamed Rage, said Saturday's withdrawal involved merely "a change of military tactics."
"The Mujahideen fighters applied military tactic changes to undermine the allied enemy of Allah, and you will soon be hearing a good news."
Shebab fighters are waging a bloody campaign to overthrow the country's Western-backed transitional government, and control large areas of the south and centre of the country.
Until Saturday morning, government and AU troops controlled just over half of Mogadishu, including the airport and port, while the Shebab controlled the city's north-east.
"The enemy is defeated, they pulled out of Mogadishu -- and we will fight them to eliminate them from the rest of the country," Somalia's prime minister Abdiweli Mohamed Ali said.
Since February, the African Union mission (AMISOM) with its 9,000 Ugandan and Burundian soldiers has clawed back key positions from the insurgents.
Major Paddy Ankunda, a spokesman for the AU's AMISOM force in Somalia, said they were reacting cautiously to the Shebab's move.
Rebel units began trundling out of the city in pickups before dawn after intense firefights with government forces late Friday night. The Al Qaeda-linked militants headed toward their strongholds across Somalia, a desolate terrain awash with hundreds of thousands of starving families enduring the Horn of Africa's worst drought in decades.
The country "welcomes the success by the Somali government forces backed by (African Union peacekeepers) who defeated the enemy of Shabab," President Sheikh Shairf Sheikh Ahmed told reporters at his residence.
He added: "It is time to harvest the fruits of peace. I call on the Somali people to help and to support their soldiers and point out any Shabab member hiding in homes."
Ali Mohamoud Rage, a Shabab spokesman, told a Somali radio station: "We have abandoned Mogadishu but we remain in other towns. We aren't leaving you. We have changed our tactics. Every one of you will feel the change in every corner and every street in Mogadishu. We will defend you and continue the fighting."
Shabab and its fierce interpretation of Islamic law, which espouses stoning adulterers and public beheadings, were despised in Mogadishu, where residents lived trapped by gunfire and artillery barrages between the rebels and government-backed troops. The capital devolved into a fearful, bloodstained, whittled version of itself as bullet-pocked buildings slumped along the Indian Ocean.
The U.S. has been concerned that the Shabab, which has connections to the Al Qaeda extremists in Yemen, would further disrupt the volatile intersection of Africa and the Middle East. In 2010, Shabab carried out twin bombings in Uganda that killed 76 people; the attacks were retribution for Uganda soldiers taking part in the African Union's peacekeeping mission in Somalia.
The rebels have been particularly brutal to their own countrymen. In recent weeks, they have deterred humanitarian organizations from reaching drought regions under their control, leaving swaths of the country scattered with starving families. Shabab has also been criticized for preventing hundreds of thousands Somalis facing famine from fleeing their territory to international aid camps.
The Islamic militants began seeping across Mogadishu in 2007, a year after Ethiopian troops invaded the country and a transitional government attempted to form a semblance of order among warring clans and religious extremists. The transitional government has received millions of dollars in Western assistance but is rife with corruption, tribal politics and an often noncommitted, underpaid army.
Surges by Africa Union forces, however, had weakened Shabab's grip on the capital. The rebels had been divided on tactics in recent months, and shortly before midnight Friday they launched attacks on government bases and troop positions. Gunshots and explosions rang across the city for hours as government-backed forces advanced on rebel strongholds.
"The government repelled the attacks and we have cleared Mogadishu this morning," government spokesman Abdirahman Omar Osman told The Times. "The security committee is in emergency meeting to restore law and order in the vacuum left by" retreating Shabab forces.
Somalis watched as militants streamed out of the city.
"I saw a convoy of about dozen pickup trucks full of fighters coming from Mogadishu," Osman Farole, a resident of Afgoye, about 22 miles outside the capital, told The Times. "Among the convoy were two black-tinted 4x4 vehicles that are supposed to carry their leaders.