PASS beyond what is described as government territory in the Somali capital — a few blocks between the airport, the harbour and the presidential palace — and you are at the mercy of al-Shabaab, the extremist Islamic group that holds sway across southern and central Somalia. Where it rules, it has implemented laws and punishments reminiscent of Afghanistan under Taleban rule.
It has banned bras, football, dancing and musical ringtones. This weekend al-Shabaab decreed that men must grow beards and shave their moustaches.
Its fighters have destroyed Sufi tombs and disinterred colonial-era Italian corpses. Its Sharia courts have ordered public floggings, the chopping off of hands and feet of thieves, the stoning to death of adulterers and beheadings of apostates and spies.
Suicide attacks and roadside bombs have grown in number, leading Western intelligence agencies to conclude that there are growing links between al-Shabaab and al-Qaeda. The agencies warn that the country is becoming a haven for international terrorists.
At the start of this year, Somalia was hoping for a new beginning. Sheikh Sharif Ahmed, a moderate Islamist, was installed as President with the backing of the United Nations as well as Western and regional governments.
Ethiopian troops who had invaded in 2006 to oust an Islamist regime — in which Sheikh Ahmed had been a leading figure — withdrew and an African Union peacekeeping mission (Amisom) promised to protect the new Government.
Today the Transitional Federal Government cowers behind 5,000 AU protectors in the piece of Mogadishu that it controls — although recently a suicide bomber struck within the supposed safe zone. In other attacks this month dozens of medical students were killed with three government ministers in a suicide attack.
At the weekend 14 people died as Government and insurgent forces traded mortar fire. Every week fresh reports of death and horror cement Mogadishu’s reputation as the worst place on earth.
Harakat al-Shabaab — meaning “Youth Movement” — emerged in 2005 as a cross-clan Islamist militia designed to support the Islamic Courts Union, which aimed to defeat the clan warlords that had devastated the country since the collapse of the last functioning administration in 1991.
In their brief reign in Mogadishu in 2006 the Courts brought peace to the city for the first time in years. When they were forced out by US-backed Ethiopian forces, al-Shabaab attracted popular support by fighting a guerrilla war against the invaders.
Many of al-Shabaab’s leaders are radical Somali veterans of the Afghanistan wars. Last year Ahmed Abdi Godane, known as Abu Zubeyr, became its top commander. He is believed to have fought in Afghanistan in the 1980s and is described by one observer as “a hardcore jihadi”.
Three months before he assumed his command, the US had designated al-Shabaab as a terrorist organisation. His predecessor, Aden Hashi Ayro, was killed by a US airstrike in May 2008.
Other senior commanders, all of whom enjoy a large degree of autonomy, include Mukhtar Ali Robow, also known as Abu Mansoor, an experienced fighter who ran the training camp from which al-Shabaab emerged, and Ibrahim Haji Jaama who won his nom de guerre “al-Afghani” thanks to years of fighting in Afghanistan and Kashmir.
Because of the growing military pressure in Pakistan, Afghanistan and Iraq, hundreds of foreign fighters have flocked to Somalia to fight Sheikh Ahmed’s UN and US-backed administration.
They have brought with them a radical ideology of global jihad and some — including a white US citizen known as “al-Amriki” — have taken leading field commander roles.
Their influence is changing al-Shabaab from a local insurgent group into a player in the wider battle between Islamic extremism and the West. “There is increasing control exercised by the foreign leadership of al-Shabaab,” said Peter Pham, associate professor at James Madison University.
“It is not just control of resources, foreign fighters and trainers, but of the actual decision-making.”
This foreign influx has strengthened al-Shabaab as a fighting force, but the creeping international agenda has also caused rifts within the group.
“There is a serious struggle within al-Shabaab between nationalists and the foreign jihadis who want to take the fight to another level,” said Abdi Rashid, a Somalia analyst at the International Crisis Group.
In recent months this has led to conflict and even some defections. At the same time, al-Shabaab has fallen out with its former ally, Hizb ul-Islam, with whom it launched a joint offensive to oust Sheikh Ahmed in May.
This staunchly nationalist group of Islamists is led by Sheikh Hassan Dahir Aweys, who helped to train the first al-Shabaab fighters and is wanted as a terrorist by the US.
This year fighting erupted between al-Shabaab and Hizb ul-Islam over control of revenues from the southern port of Kismayo.
This has since turned into a deeper split. “Hizb ul-Islam’s orientation is domestic but al-Shabaab’s focus is on a broader ideological Islam,” said Dr Pham.
Sheikh Ahmed’s enfeebled administration is in no position to take advantage of such divisions. In Mogadishu, a tense and deadly stalemate exists, with al-Shabaab unwilling to take on the peacekeepers’ tanks and artillery and government forces incapable of winning.
Sheikh Ahmed’s besieged government barely exists: it does not control the country’s territory, cannot provide security and lacks a popular mandate.
“It will continue as long as the Amisom troops are there to guard it. If they were withdrawn it would collapse within hours,” said Dr Pham.