Abdirahim Sheikh joined al-Shabaab after they visited him on his farm in southern Somalia to tell him that "foreign invaders" were abusing the Koran. He says the next three years of his life fighting for the radical Islamic militia were unimaginably tough. There was frequent bloody action on the front line and little or no care for the wounded who died in large numbers. But his morale only started to drop when he heard that fellow jihadists had killed worshippers at a mosque.
"If someone who is praying in a mosque can be killed then al-Shabaab are the infidels," said the 30-year-old. Standing in Mogadishu's ruined stadium, which the militia used as a training base during their long battle for the Somali capital, the farmer has switched sides and joined the war against them. He decided to defect, he said, after seeing a friend executed in front of him. The man was accused of planning to defect and the commander slit his throat as a warning to the others. That warning backfired. "After that the defections became a flood," said Abdirahim.
It is just over a year since al-Shabaab abandoned the crumbling sports ground and the rest of the city, leaving behind them the huge rusted metal plates speckled with shrapnel where their gunners practised piercing the armour of the African Union forces. The bowels of the stadium are now occupied by their former foes and a handful of al-Shabaab defectors who fled across the lines of a battle that the Islamic extremists appear to be losing.
The retreat that began at the height of the Horn of Africa famine in August last year has now reached the militants' once unassailable stronghold of Kismayo. The militant fighters last week trekked out of the historic port of Marka to the south of the capital. African Union forces have this year seized control of strategic towns like Afgoye outside the capital and Afmadow in the south. Now, the Islamists' commanders are reported to have left Kismayo, with residents in the port city seeing the militants withdraw their heavy weapons and larger trucks this week.
The series of reverses has led some observers to question whether a military defeat of Harakat al-Shabaab al-Mujahideen is now within reach. Abdirashid Hashi a Somalia analyst with the International Crisis Group (ICG) said that he expects Kismayo to be recaptured but that the war will continue in another guise. "Al Shabaab has been deserting or retreating from towns and cities since last year. But their ideology and many of their fighters are still there," he said.
"They are wounded and their strategy will now be to bide their time in the countryside and wait for the foreign forces to leave. They believe that time is on their side and they can fight a guerrilla war."
It is only six years since Ethiopian forces swept into Somalia with the political and military backing of the United States to topple the Islamic Courts Union, an Islamist movement which had taken control much of south and central Somalia after years of disastrous feuding between warlords. Ethiopia's vastly better-equipped forces quickly routed the youth militias loyal to the courts with hundreds killed or driven from the cities.
However, the Ethiopian intervention bolstered nationalist support for the courts' military wing helping to create al-Shabaab in its current form. Within a year the occupiers wearied of the guerrilla war and withdrew.
Now the foreign forces – comprising troops from Uganda, Burundi, Djibouti and Sierra Leone, as well as Kenyans in the south – have some legitimacy under the umbrella of the African Union. After costly early mistakes, the AU force in the capital has restored some semblance of order enabling a freshly assembled parliament to elect a new president last month. The government of Hassan Sheikh Mohamud, the surprise winner among the MPs, has UN backing but also, crucially, some support among Somalis themselves who were largely contemptuous of his predecessors in the corrupt and squabbling Transitional Federal Government – an administration that a UN report uncovered was stealing 7 out of every 10 dollars it received in aid. The relative security in Mogadishu has seen people and money pour in from the Somali diaspora. Something of a revival is clearly underway.
But there is mounting concern that a botched operation to recapture Kismayo could undermine support for the new government and for the African Union Mission in Somalia (Amisom). Thousands of residents have streamed out of the port city in recent days as Kenya's navy has rained indiscriminate shellfire on the city.
"They are shelling everyone, everywhere," a Kismayo resident told The Independent by telephone from the besieged city. "The people are now understanding that the Kenyans have no plans to save the people." Kenya's land forces, operating under the banner of Amisom, have advanced to within 40 kilometres of the city. They have so far ignored appeals to establish a humanitarian corridor. Witnesses in nearby villages said the troops are firing on "anything that moves in front of them".
An equal or greater threat to southern Somalia may come from an imminent power struggle for the port city between competing clans. Similar struggles between Somalia's complex of clans and sub-clans were largely responsible for 20 years of civil war that followed the collapse of the last central government in 1991.
Al-Shabaab proved adept at managing the clan system in cosmopolitan Kismayo. In recent days they have allowed hundreds of lightly armed fighters from the Hawiye clan to move into the city. A warlord from the rival Marihan clan, Barre Hiiraale, is reported to be bringing his fighters to the city with the backing of Ethiopia. Meanwhile, the Kenyan advance from the south has been achieved with the backing of the Ras Kamboni militia from another rival clan, the Ogadeni.
The convergence of forces could see a three-way fight between proxies of Ethiopia, Kenya and al-Shabaab, an outcome that could restore some nationalist support for the Islamic militants after a year at bay.