As David Cameron visits Algeria, it seems that Downing Street is only now realising just how long-term a project defeating the Islamist rebels in North Africa will be.

Malian soldiers arrest a man suspected of being an Islamist in Timbuktu. Photograph: Getty Images

David Cameron’s visit to Algeria is the first since that country won its independence from France 51 years ago. No former British leader thought it worth the time or effort. The decision comes after the penny finally dropped in Downing Street: forget Afghanistan or Pakistan; the threat from al-Qaeda is on Europe’s doorstep.

The area of operation for al-Qaeda in the Islamic Maghreb (AQIM) and its affiliates, offshoots and allies stretches from Mauritania to Chad. Some reports suggest that Nigerian militants of Boko Haram received training in Somalia, which would mean that the al-Qaeda arc can be traced from the Atlantic to the Red Sea.

The French intervention in Mali is just the latest instalment in this much wider conflict. With hardly a shot fired, and to the cheers of local people, French paratroops retook the ancient desert city of Timbuktu. “Operation Serval”, as the French term their offensive, has gone at least as well as anyone in Paris could have wished.

The question now is how the French-led operation will proceed. Paris has been keen to replace its 2,900 troops with an African army, and pledges of support from West Africa have been coming in. Some 1,750 African troops have already arrived – from Togo, Niger, Nigeria, Burkina Faso, Benin and Senegal. Almost 8,000 African troops are expected, although the deployment has been slow.

Less than two years ago Mali’s Assistant Chief of Defence, Colonel Béguélé Sioro, described this training as an “exemplary partnership” offering an “opportunity to evolve alongside seasoned troops, accumulate experience in the fight against criminal organisations and increase our operational effectiveness.”

Yet when the Islamist fighters launch an offensive, pushing out the Malian army from the central town of Konna on 10 January, the Malian armed forces all but collapsed. Mali's interim president Dioncounda Traore had no choice but to turn to Paris for help.

George Joffe, North African specialist at Cambridge University, says the weakness of the Malian army was exacerbated after American aid was cut, following the Malian coup of March 2012. He believes the rebellion will to a tough nut to crack.

Europe’s head of counter-terrorism, Gilles de Kerchove, told the French News Agency, AFP, that intelligence reports indicated that the Islamists have around 3,000 fighters. American sources, speaking to the New Statesman off the record, suggested that the Islamists began melting away into the community as the French advanced. Some villagers were forced to leave their homes as fighters moved in to pass themselves off as local people.

In the longer run, says Joffe, the rebels may retreat to their desert fastness of Taoudenni. These salt-mines are on the ancient trade routes that ran from Morocco to the Gold Coast, or present-day Ghana. “They are riddled with deep mines and passages,” he says. “For a decade the Islamists were there, undisturbed, and they could retreat to this sanctuary if forced out of central Mali.”

Crushing the Islamist rebels is likely to be a long-term project. Their fighters have yet to be defeated and African forces nowhere near ready to take over from the French. The mostly likely outcome of the conflict is that Paris will have to carry the burden for years to come. France launched Operation Epervier to save Chadian president Hissene Habre in February 1986. They are still there today.