When Mali's Tuareg nomads launched a rebellion in January, many in Africa thought it would be just the latest in a long line of desert uprisings to be swiftly placated with offers of cash and jobs.
Some optimists mused that the indigo-turbaned northerners might even take on the local arm of Al-Qaeda, which was plying a disruptive trade in Western hostages and trafficked goods.
But instead, the Tuaregs' struggle for an independent homeland has been hijacked by better-armed Islamists from Mali and abroad, creating a safe haven for militants in the Sahara that is already being compared to similar bastions elsewhere.
"We are in an early stage of Afghanistan and Somalia. There is no doubt in my mind," said Ahmedou Ould-Abdallah, a Mauritanian diplomat who has been a United Nations envoy in both west Africa and Somalia.
Mali is still a long way from the Taliban-ruled Afghanistan of the 1990s from which Osama bin Laden's then little-known Al-Qaeda readied the Sept. 11 attacks on U.S. targets in 2001.
And the desert trade in hostages, narcotics and other goods has yet to reach the scale of the piracy off the east coast of Somalia, estimated to cost the global economy $7 billion a year.
But Ould-Abdallah and a swelling chorus of security experts point to an influx of foreign fighters, a debilitating rivalry between neighbouring states, and steady flow of illicit funds as making Mali and the wider Saharan zone the next one to watch.
In former colonial power France, the new defence minister warned last week of a "west African Afghanistan" in Mali.
The rebels' seizure of three major airstrips in the north - near the towns of Gao, Timbuktu and Tessalit - means that, in the absence of a functioning Malian air force, they can ferry in everything from drugs and weapons to yet more foreign fighters.
While some believe the threat can be contained within the area, others think it will stretch further afield. Among the latter is the African Union, whose chairman last week called for the United Nations to back a regional force to intervene.
"All the way across Europe, there is growing concern," one Western diplomat working in the region told Reuters.
"We have to recognise that it cannot be contained in northern Mali or even west Africa."
"COOL PLACE FOR JIHADIS"
The Sahara, and the Sahel scrubland which skirts it to the south, had already been inching up the global security agenda in recent years as Al-Qaeda in the Islamic Maghreb, a franchise of the militant network, became more active in the zone after a crackdown by authorities in Algeria, where AQIM has its roots.
The overspill of arms and fighters from last year's Libyan war into an already fragile neighbourhood added a new layer of insecurity even before the rebellion in northern Mali.
When Malian government troops were routed in early April, a variety of groups entered the fray, in many cases appearing openly in the main towns for the first time. They included men declaring loyalty to Al-Qaeda and to AQIM splinter groups like the little-known MUJWA, as well as some members of Nigeria's Islamist militant organisation Boko Haram.
"It has become a cool place for jihadis from the region," said one U.S. official with knowledge of the situation, adding that gunmen were also coming in to northern Mali from Tunisia, Morocco and Mauritania.
Early developments in the rebellion focused on the secular National Movement for the Liberation of Azawad (MNLA), whose slick, European-based PR machine and Tuareg sympathisers hailed a series of small victories notched up against the army as they sought to carve a state they call Azawad out of the desert.
But the complex nature of the uprising emerged after a coup on 22 March in the Malian capital Bamako, far to the south, by soldiers angry at the government's failure to contain the revolt. Their coup, however, merely emboldened the rebels to make a lightning advance.
As rebel forces took major towns such as the ancient city of Timbuktu, it became clear that MNLA fighters were operating alongside a newly formed Islamist movement known as Ansar Dine, whose stated goal is to impose Islamic law, sharia, across Mali.
Ansar Dine is run by Iyad Ag Ghali - described in a leaked U.S. diplomatic cable from as "northern Mali's undisputed power broker". In two decades navigating northern Mali's tribal and political circles, Ag Ghali led two previous Tuareg rebellions, had a stint as a diplomat in Saudi Arabia and, once back home, acted as an go-between in hostage bargains with Al-Qaeda cells.
Diplomats in Mali said Ag Ghali formed Ansar Dine, commonly translated as Defenders of Faith, last year after being rebuffed in separate efforts to head both the MNLA and his Ifoghas Tuareg clan: "He lost the tribal line. He lost the rebellion. What does he have left? Religion," said a diplomat based in Bamako.
POWER-SHARING DEAL
Alongside the MNLA, Ansar Dine has jointly controlled Mali's north for two months. It was initially welcomed by local people for restoring a semblance of order after three months of violence and disruption. But it is now facing increasing hostility to its efforts to impose sharia on populations with a long history of practising a more liberal style of Islam.
Girls and boys have been separated in schools. Residents have been whipped for drinking alcohol and smoking and hundreds took to the streets of the town of Gao to protest last month when Islamists there banned soccer and television.
Yet if imposing sharia has won Ag Ghali little popularity, it has been crucial in drawing him closer to AQIM, a group with which he was already familiar - literally, through family connections - and which he now needed for its firepower and the cash it had accumulated after years operating in the area.
Such has been the rapprochement that Ag Ghali is now understood to have an Al-Qaeda nom de guerre - Abu Fadhil.
"(Ag Ghali) is using religion, but his aim is political," said Mohamed Coulibaly of the Dawa movement, which preaches the same conservative form of Islam as that espoused by Ag Ghali but which rejects violence.
Ansar Dine and AQIM each number around 500 fighters, giving them a combined headcount roughly equal to that of the MNLA and substantial clout in an area the size of Spain with a population of little over a million.
Witnesses say the Islamists are better-resourced and more heavily armed than the Tuareg separatists, however, allowing them to shunt the MNLA aside and take effective control on their own of towns across northern Mali.
The government in the south is labouring with a fragile transition back to civilian rule after the 22 March coup and its army is still licking its wounds after the rebel advance, so Bamako is in no position to take back the north any time soon.
While the government rejects the MNLA's secession, there might have been scope for negotiations on easing poverty in the north that could have provided a platform for resolving the rift in the country. But the marginalisation of the secular MNLA by the Islamists makes even that degree of dialogue impossible.
The MNLA now appears to risk tearing itself apart over a proposed power-sharing deal in the north with Ansar Dine - with the latter saying sharia is a non-negotiable part of the deal even as it consolidates its positions on the ground.
Short link: