It was always probable that French military intervention in Mali would have explosive consequences in other parts of the region. Even so, it is surprising that a splinter group from al-Qa'ida in the Islamic Maghreb (AQIM) should have been able to react so quickly by seizing hostages at the gas field facility at In Amenas in south-east Algeria.

The speed of the jihadi retaliation has led to doubts that the two events are connected, but the likelihood must be that French action in Mali precipitated a pre-planned assault on this target. It is a typical al-Qa'ida operation, in the tradition of 9/11, geared to attract maximum worldwide attention by a suicidal act of extreme violence.

Foreign leaders were swift to back the French action and pledge to pursue the perpetrators of the hostage-taking to the ends of the earth. This is the sort of reaction al-Qa'ida intends to provoke, whereby a small group of gunmen is presented as a threat to the rest of the world. Recruits and money flow in.

Download the new Independent Premium app Sharing the full story, not just the headlines

Local disputes – in this case between the Tuareg of northern Mali and the government in the capital, Bamako – become internationalised. Foreign military intervention may restore order and even be welcomed by the local population in the short term. But the presence of a great power can be destabilising.

This was one of the many lessons of the US takeover of Iraq and Afghanistan. Most Iraqis and Afghans were glad to see the departure of the previous regimes. Iraqis wanted an end to Saddam Hussein's rule, but this did not mean that they welcomed foreign occupation. Similarly, in Afghanistan, foreign forces were initially popular and the Taliban discredited. But in both cases foreign forces soon behaved like colonial occupiers, and were resented as such.

Will this now happen in Mali? There is plenty of evidence that the jihadi fighters of AQIM, Ansar al-Din, and the Movement for Oneness and Jihad in West Africa are feared and hated in south Mali where most of the 14.5 million population live. They are not much more popular in the north where they have imposed sharia.

The Americans might well have got away with military intervention in Iraq and Afghanistan if they had then got out quickly. The same is true of the French in Mali. The danger for them is that they will stay too long, become entangled in ethnic rivalries, and keep in power a dysfunctional and corrupt Malian government.

The political earthquake zones of the world have tended to be in countries where there are deep ethnic or religious differences. The list includes Afghanistan, Iraq, Bahrain, Syria, Lebanon, Cyprus, the former Yugoslavia and Northern Ireland. Mali fits all too well into this pattern. The north of the country has had a simmering Tuareg rebellion from at least 1963. The latest crisis has its origin in a nationalist uprising by the Tuareg in 2012. The opportunistic takeover of the rebellion by the jihadi groups came a few months later after a military coup in Bamako.

In Syria and Iraq, internal crises are exacerbated by interference from neighbours, with their own interests and local proxies. Here, again, there is a strong parallel with Mali. Algeria, Libya, Niger and Burkina Faso all have impoverished and restive Tuareg minorities. Their governments pretend their main concern is the threat of Islamic fundamentalism because this presses the right buttons in Washington, London, Paris and Moscow. But the recent history of the region shows that their real concern is Tuareg separatism. The threat is all the more serious for them because, poor though the Tuareg may be, they are often living on top of great reserves of oil, gas, uranium and valuable minerals.

Tuareg nationalist insurgency, not radical Islam, is at the heart of the crisis in Mali. What, for instance, are AQIM doing in northern Mali, which has never in the past been a bastion for fundamentalists? AQIM is in origin an Algerian movement that emerged from the civil war of the 1990s. Formed in 1998, its members moved to northern Mali in 2003, where the government saw it as a counterbalance to Tuareg separatists. For all the French rhetoric about AQIM being a threat to Europe, the group made no attacks there over the past decade, being more interested in raising money through hostage-taking and smuggling cigarettes and cocaine.

Algeria's links to AQIM are cloudy, but not so the movement's past connection with the Malian government. The strange truth is that it was the Malian government which, over the last 10 years, tolerated AQIM in northern Mali and allowed it to operate, taking a share in the profits of its kidnapping and drug-running operations. International military aid for use against al-Qa'ida was diverted for use against the Tuareg.

There are few eyewitnesses able to give convincing accounts of developments in northern Mali, but one is May Ying Welsh, a journalist working for al-Jazeera. She writes after a recent visit that "for years, Malian Tuaregs have been complaining that their government was in bed with al-Qa'ida, but their cries fell on deaf ears". She quotes a Malian army commander, Colonel Habi al-Salat, who defected to the Tuareg rebels in 2011, as saying, "Mali facilitated al-Qa'ida, providing them with complete freedom of movement, because they believed the presence of this group would impact the Tuareg struggle against the governing regime."

The latest Tuareg uprising of 2012 was precipitated by the fall of Gaddafi in Libya a few months earlier. He had long kept a sort of order in the states in and around the Sahara. His defeat also meant the region was awash with modern weapons. Tuareg in the Libyan security forces, who knew how to use them, were coming home. The Tuareg rebellion was led by the National Movement for the Liberation of Azawad, which was then pushed aside by Ansar al-Din and its jihadi allies.

The French may calculate that they can use their air force to destroy Islamist units. This worked well for Nato in Libya. But against guerrillas in a desolate country with a ferocious climate, this may not be so effective. Air power works best against fixed positions or vehicles, but kidnap victims in Mali report the Islamists have hidden fuel, water and food across the country and have hacked hideouts into the sides of cliffs. They will be a difficult enemy to defeat.