

Against this backdrop, Timbuktu's self-appointed rulers have been publicly executing accused murderers, stoning to death suspected adulterers and amputating the hands of alleged thieves, all under the group's rigid interpretation of Islamic law. Last week a senior UN official warned that Islamist groups were ''buying'' child soldiers, as well as using rape and forced marriage as weapons of war. ''You cannot imagine what Timbuktu is like now,'' one prominent Tuareg refugee told The Age from exile in Mauritania. ''There is no food, schools are closed and people are afraid to speak, afraid even to leave their homes.'' Timbuktu's new Islamist rulers have also swept aside local protests and destroyed the tombs of revered saints, including some that are inscribed on UNESCO's World Heritage List. The tombs were contrary to Islam, said the new rulers, arguing that Muslims must pray not to saints but to God. The International Criminal Court has described the tombs' desecration as a possible war crime. But more than these serious cultural crimes, the domestic regime of terror and the resulting humanitarian crisis in one of the poorest regions on earth, it is the freedom with which al-Qaeda and its extremist brand of Islam is now able to operate that has Western governments worried.

The region ''is on its way to becoming a second Afghanistan, or rather a second Somalia'', the UN's envoy to West Africa and Somalia, Ahmedou Ould-Abdallah, said in June. ''There is no doubt about that.'' Rumours of an al-Qaeda presence in northern Mali have been around for a decade. The difference now is that al-Qaeda suddenly holds the keys to power. In 2002, a loose affiliation of fundamentalist Islamist groups that would later call itself al-Qaeda in the Islamic Maghreb (AQIM) established a foothold in the region. Taking advantage of impoverished governments, porous borders and the Sahara's remoteness, they began by infiltrating lucrative trans-Saharan smuggling routes, drawing on the proceeds to run charitable institutions in northern Mali. But it was in 2003 that AQIM first came to international attention with the kidnapping of 32 European hostages in the Sahara. To secure the hostages' release, the German and Malian governments reportedly paid a ransom of millions of euros. Thus were born an industry and a lucrative source of funding: by late 2010, Algerian government sources estimated that AQIM had reaped about €50 million in ransoms. Not long after al-Qaeda had established a presence and funding source in the north of Mali, the Pentagon called the world's largest desert ''an al-Qaeda terrorist zone'', warning of al-Qaeda training camps in the empty wastes of the Sahara.

In response, the US government launched its Pan-Sahel Initiative (PSI) in 2004, sending marines and private contractors into Saharan countries to train poorly equipped national armies in counterterrorism strategies. Joint military exercises have since become an almost annual event. From an al-Qaeda perspective, the open spaces and often undefended borders of the Sahara and neighbouring Sahel must have seemed like the ideal base. This is a land of low sand hills, seemingly endless gravel plains lightly haired with thorn scrub and remote mountain ranges - ''the Sahara's Tora Bora'', according to the Pentagon - beyond the control of any government. Extensive tracts of the Malian Sahara are uninhabited and a Malian government spokesman has admitted that ''even the government acts as if it's no man's land''. Even so, the threat from AQIM was largely contained until the war in Libya. ''Those who took the decision to bombard [Libya],'' said one French diplomat, ''did not have the least idea of the consequences it could have for the south [of the region].'' For decades, Colonel Gaddafi had offered refuge and military training for rebel fighters exiled after rebellions in northern Mali and elsewhere. Most of these exiles were members of the Tuareg ethnic group, the once-nomadic people of the Sahara; many Tuareg believe that the government in far-off Bamako, a government that some Tuareg consider to be a foreign power, had both repressed and neglected the region since Mali's independence in the 1960s. These exiles later served in Colonel Gaddafi's elite forces, including the Islamic Legion that saw action in Chad, Lebanon and elsewhere. At the height of the Libyan conflict in 2011, reports emerged from northern Mali that Gaddafi envoys were offering up to $US10,000 a day to Tuareg fighters to join the Libyan army. Hundreds reportedly did so. Thanks to this and Colonel Gaddafi's very public support for Tuareg causes, the Tuareg were seen as one of few reliable allies for the embattled Libyan leader in his final months.

When Gaddafi was finally driven from power, many Tuareg fled south across the desert to Niger and then Mali. They carried with them what an International Crisis Group (ICG) report on the conflict called ''a massive transfer of Libyan arms across the Sahel belt''. In such an expansive region with few roads, the poorly resourced governments of Niger and Mali proved largely incapable of disarming these well-armed convoys. One that the authorities of Niger did manage to stop contained worrying news. ''In June 2011, the Nigerian authorities intercepted a convoy transporting several hundred kilograms of explosives,'' the report said. ''The trafficker arrested on that occasion said that AQIM was due to take delivery of them in Mali.'' Waiting for these well-armed exiles in Mali was a fragile democracy whose Tuareg population stood, not for the first time, on the brink of open rebellion. The exiles from Libya joined forces with a Tuareg rebel group, the National Movement for the Liberation of Azawad (MNLA) whose goal was complete independence from Mali. The MNLA made rapid gains. In late March, the democratically elected Malian government of Amadou Toumani Toure - long considered a model of stable democracy in West Africa- was overthrown in a coup d'etat by soldiers angry at the president's handling of the crisis in the north. Within weeks of the coup, Timbuktu and a vast swath of northern Mali was in rebel hands.

But just as the Tuareg stood on the brink of historic victory, their secessionist and largely secular rebellion was hijacked by al-Qaeda affiliates. With the major population centres of the north under rebel control, Ansar Dine (''Defenders of the Faith''), a small band of fighters who had fought alongside the MNLA but who were allied with AQIM, brought the formidable financial resources of al-Qaeda to bear on their one-time allies: within days of seizing Timbuktu Ansar Dine expelled the MNLA from all rebel-held urban centres. Fighters from regional Islamist groups - including the feared Boko Haram from Nigeria - swelled their ranks as they prepared for an armed response from the Malian government. Until that response comes, al-Qaeda is closer than it ever has been to controlling its own state. And according to the ICG, ''Mali is now on the brink of sheer dissolution''. Such is AQIM's power and ambition that even their former allies have taken to warning about the dangers of fundamentalist extremism. ''Saudi Arabia, the US and all the other nations are suffering because of al-Qaeda,'' one MNLA commander told al-Jazeera. ''They could not find a solution to it. How can we?''

Meanwhile, comparisons between Mali and Somalia are inescapable. In both countries, al-Qaeda-affiliated Islamist groups - Ansar Dine in Mali, al-Shabab in Somalia - have exploited a political vacuum to establish a territory free from government interference and controls over the flow of arms. From here, they have used kidnappings and ransom demands to build up a well-resourced power base. And they have provided a haven for foreign fighters to operate with impunity. What this means for the export of terrorism is unclear, but the lessons of history are sobering: at the height of the insurgency in Iraq, French intelligence services estimated that 20 per cent of suicide bombers in Iraq came from the ranks of AQIM. And there are signs that AQIM members have infiltrated armed militias in Libya, among them Ansar al-Sharia, which carried out the attack on the US consulate in Benghazi in which ambassador Christopher Stevens and three others were killed. In the attack's aftermath, US Secretary of State Hillary Clinton warned that ''for some time, al-Qaeda in the Islamic Maghreb and other groups have launched attacks and kidnappings from northern Mali into neighbouring countries. ''Now, with a larger safe haven and increased freedom to manoeuvre, terrorists are seeking to extend their reach and their networks in multiple directions. And they are working with other violent extremists to undermine the democratic transitions under way in North Africa, as we tragically saw in Benghazi.''

The Sahara's proximity to Europe and the ease with which would-be terrorists can enter and leave the region ensure that there is a growing international consensus that military action in Mali may be required. Last month the Malian government finally (if reluctantly) agreed to host a 3000-strong West African force. Last week, the UN Security Council adopted a resolution asking ECOWAS, the regional bloc of West African states, for a detailed plan for military intervention within 45 days. But any military action in the Sahara is fraught with peril. The area where al-Qaeda holds sway is vast and difficult terrain, and the situation is complicated by the presence in the region of at least 11 European hostages. Further, the Malian army is in disarray even as the Malian government's hold on power remains fragile. As ever with al-Qaeda, there are no easy answers. But the growing momentum behind the need for military action suggests that the considerable risks of joining battle in the Sahara may be nothing when compared with the dangers of doing nothing. Anthony Ham is a journalist based in Madrid.