(Repeats, text unchanged)
By David Lewis
DAKAR, Jan 15 (Reuters) - A powerful southern offensive by Islamists in Mali last week, halted only by French air strikes, showed that a loose alliance of rebels from al Qaeda's North African wing and local groups has been united by the threat of foreign intervention.
When the coalition of Islamists swept across northern Mali last year, massacring army troops and carving up the vast desert zone, ties between Al Qaeda in the Islamic Maghreb (AQIM) and local groups Ansar Dine and MUJWA had looked opportunistic, and regional mediators believed they could prise them apart.
Some fighters imposed strict Islamic law and recruited foreigners and locals hungry for jihad, others framed the conflict around local Malian tribal politics and religion, while criminal networks smuggling drugs and contraband joined the fray, earning them the title "gangster jihadists".
With Mali's army crippled by political divisions and a series of defeats to rebels that led to a March coup, West African mediators tried to divide the rebels by offering talks to local Islamists while excluding foreigners, extremists and criminals.
U.N. backing in December for an African-led intervention due later this year changed the picture.
"People in the north don't have any choice now but to stand together," said Algabass Ag Intallah, a senior member of Ansar Dine, a group that only last month had committed to peace talks with Mali's government. "This is an aggression. We all have to defend ourselves."
"Al Qaeda helped us, but we are the ones who are leading," he added.
Residents in the north-eastern Malian town of Gao, MUJWA's stronghold, confirmed pick-up trucks carrying its turbaned fighters had also joined the rebel offensive.
The seizure by Islamists of the northern two-thirds of Mali, for decades one of West Africa's most stable democracies, sowed fears that its desert dunes and craggy mountain ranges could become a base for terrorist attacks on Europe.
Yet as Islamists severed limbs, silenced music and smashed traditional Sufi shrines in the ancient caravan town of Timbuktu - acts reminiscent of Afghanistan under the Taliban - Malians and foreign powers wavered throughout 2012.
Much of the delay was due to confusion over the nature of the Islamist alliance, experts say.
Some governments advocated dialogue to tackle the long-standing political grievances of those living in Mali's under-developed north. Others, led by France, called for swift military action to stamp out a security threat, finally winning U.N. backing for an African-led operation.
These divisions evaporated lat week with the united rebel advance on the central town of Konna, a gateway toward the southern capital Bamako, deemed so dangerous that Paris reversed pledges not to intervene directly. The African force, which had not been expected until September, is being hastily rolled out.
Even Algeria, which had previously hoped to unravel the coalition by enticing Ansar Dine into peace talks, dropped its opposition to military intervention, allowing French Rafale jets to fly via its airspace to pound the rebels.
"Ansar Dine, MUJWA and AQIM worked together and coordinated their push on Konna," said France's military chief Admiral Edouard Guillaud, whose jets and helicopter gunships have strafed rebel columns, training camps and fuel depots.
Behind Mali's reputation for stability, Al Qaeda's presence there has worried regional powers and Western nations for over a decade. The United States has led efforts to train national armies and improve security coordination within the region.
Until last year, AQIM had struggled to break from its Algerian roots and activities focused on the multi-million dollar business of taking hostages for ransom, including eight French citizens it still holds captive. Its numbers were limited to a few hundred mobile fighters in the remote desert.
However, last year's rebellion - launched by Tuareg separatists but quickly hijacked by Islamists - changed all that.
In Iyad Ag Ghali, a veteran of previous Malian Tuareg rebellions who had acted as a negotiator in hostage releases, AQIM found an ally to expand their local presence in return for arms and funding, diplomats said.
Ag Ghali, described in U.S. diplomatic cables as an expert at "playing all sides", had sought to lead the Tuareg separatists. When he failed, he split from them to found Ansar Dine, with AQIM's backing. Previously known for his love of the high life, Ag Ghali has over the last decade became a convert to fundamental Islam.
After routing Mali's army and sidelining MNLA Tuareg separatists, Ansar Dine occupied Ag Ghali's fiefdom around Kidal in the far north.
MUJWA emerged in late 2011 as a splinter from AQIM, establishing itself by recruiting among Arab and black African communities in Mali and elsewhere in the region. Tapping into fears of dominance by the minority Tuaregs, the group was able to wrest control of Gao - northern Mali's largest town - from the separatists in June.
Al Qaeda fighters have since drifted between these groups but been more present in Timbuktu, experts say.
Washington estimates the core of the combined Islamist force to be 800 to 1,200-strong. A military plan drawn up by West Africa's ECOWAS bloc estimated the rebel fighting ranks just over twice that size.
With Mali's army in tatters and neighbouring African states needing time to pull together an intervention force, hopes for regional mediation had focused on Ag Ghali's Ansar Dine.
"Ansar Dine had all the opportunities to talk. We wanted to bring Ansar Dine to the table. I don't know why they made the other choice," said a senior West African official involved in the negotiation process. "In this war, they are all together."
A former senior Malian intelligence officer said Ag Ghali's commitment to fundamentalist Islam - cultivated during years spent in the Gulf and through connections in the proselytising Muslim movement Tabligh - had been underestimated.
Mali and other countries in the region say scores of fanatical foreign fighters have flocked to the north. Independent reports on their numbers and their origin vary wildly.
"The numbers I have heard range from 100s to 1,000s, so it is clear that no one has much of a clue," a senior Western security official told Reuters.
A Reuters correspondent travelling in Gao in the weeks before the French intervention reported at least three white Westerners in the Islamist ranks there.
French officials have said about 10 of its citizens have been arrested trying to reach Mali to join the rebels. Late last year, the FBI arrested two U.S. citizens they said were planning to travel to West Africa to carry out jihad.
But the most serious threat could stem from closer to home.
Officials and residents say MUJWA, based in the eastern town of Gao, has succeeded in recruiting black Africans from Mali and elsewhere in the West African region in a way AQIM never did.
The West African official involved in the mediation process called it a "gangrene" that had been underestimated.
Marc Trevidic, France's top anti-terrorism judge, warned that Mali was the first case of jihad in sub-Saharan Africa.
"For the first time there is a 'black jihad': a jihad done for blacks by blacks," he told Reuters, saying its militants were both West Africans and dual nationals able to move freely in and out of France.
Paris is concerned at the ability of African Muslims, some of whom have dual nationality, to move between France and the region.
"That is the number one potential threat. It is the number one enemy to France," he said. (Additional reporting by John Irish in Paris; Editing by Daniel Flynn and Will Waterman)