Four years ago, French forces intervened in Mali, successfully averting an al Qaeda-backed thrust toward the capital of Bamako. The French operation went a long way toward reducing the threat that multiple jihadist groups posed to this West Africa nation. The situation in Mali today remains tenuous, however, and the last 18 months have seen a gradual erosion of France's impressive, initial gains.

To ensure a significant new threat does not materialize in Mali again, France will need staying power — and support from other countries, including the United States.

The 2013 French intervention in Mali rid the country of what French security experts referred to as “Malistan” — a huge al Qaeda safe haven in the northern half of the country that had grown increasingly reminiscent of Afghanistan on the eve of the 9/11 attacks. Over the course of the first few months of that year, French Special Forces, operating in close coordination with traditional French army and air force and with the support of the French Navy, destroyed the al Qaeda safe haven and restored Mali's territorial integrity.

Subsequently, an African-led United Nations stabilization operation was deployed and French forces re-postured to focus on counterterrorism across a broader range of states including Burkina Faso, Chad, Mauritania, and Niger. The European Union meanwhile deployed a training operation to Bamako to help the Malian military rebuild so that it might eventually retake effective control of the North.

Training the Malian army and preventing the resurgence of al Qaeda and other terrorist groups in Mali, however, has been a tough and often frustrating task.

For one thing, several jihadist groups continued to operate in Mali.

Al Qaeda in the Islamic Maghreb (AQIM) was badly damaged by the initial French attacks, but some of its key leaders, such as Mokthar Belmokthar survived. Initially an al Qaeda battalion commander, Belmokthar broke away from AQIM and formed a group now known as al-Mourabitoun. Under Belmokthar's leadership, al-Mourabitoun first distanced itself from al Qaeda but has since returned to the fold. Some believe that Belmokthar was killed in Libya in a 2015 U.S. airstrike, but his battalion continues to operate in Mali.

Other groups, including the Movement for Unity and Justice in West Africa (known by its French acronym, MUJAO) and Ansar al Dine continued to operate around Gao and other northern Malian towns. In 2015, a new group known as the Macina Liberation Front emerged, seizing headlines with a number of attacks across the country.

In November 2015, al Qaeda, working in conjunction with al-Mourabitoun, stormed the Radisson Hotel in Bamako, taking 170 civilians hostage. This brazen attack on a key Bamako hotel (I, like many foreign researchers, have stayed there) was a clear sign that security was deteriorating.

Subsequently, AQIM claimed responsibility for attacks in other parts of Mali as well as neighboring countries. In early 2016, for example, the group targeted neighboring countries that had contributed troops to the UN stabilization mission in the North — Burkina Faso and the Ivory Coast. By some counts, AQIM and groups aligned with it have conducted over 100 attacks — albeit many smaller scale — in the last year alone. Meanwhile, it has continued its lucrative kidnapping for ransom operations.

Looking ahead, one factor that will likely impact AQIM's strength is the Islamic State's (ISIS) future.

The question now is whether ISIS' falling fortunes will benefit AQIM in Mali.

The jihadist milieu in Mali has always been a mishmash of small groups with short-lived alliances of convenience and shifting loyalties. When ISIS was on the rise in late 2014 and 2015, some Malian jihadist groups pledged allegiance. A split reportedly emerged within al-Mourabitoun, between those who wanted to throw their lot in with the newest global jihadist movement and those who did not (including Belmokthar). ISIS is now in retreat, including in Libya, where it has been chased from its stronghold of Sirte. The question now is whether ISIS' falling fortunes will benefit AQIM in Mali. It well may do so.

Another factor is that even though jihadists no longer control population centers in Mali, their persistence has helped undermine the broader state-building and reconciliation efforts that the country much needs.

There has been little progress on implementing the peace accord signed in Algeria in 2015. This is troubling because Mali's North-South conflict was what opened the door to the takeover of the North by al Qaeda and its associates back in 2012. More generally, Mali and many parts of the region remain a ripe culture for the growth of Salafi jihadist groups, due to socioeconomic factors and the continued activities of Wahabbists.

In light of this, French staying power in Mali will be a determining factor in al Qaeda's future prospects.

France maintains more than a thousand troops in Northern Mali and has continued operations there against jihadist groups, even as it extends those operations to a broader range of countries. As reported last week in the French newspaper Le Monde, French forces have killed several al Qaeda leaders and associates, including Abu Baher al Nasr, Ahmed Al Tilemsi (a pro-ISIS Mourabitoun leader), and Omer Ould Hamah.

Yet the French security services are under enormous strain elsewhere in the world, facing a mounting domestic terrorist challenge at home and the need to continue operations against core ISIS in the Levant as well as in Libya. Of course, the domestic French terrorism threat is ultimately what drives French operations in Mali and the broader region. France still may find it challenging to sustain its mission in Mali over the long term, especially if the broader security situation there erodes and the political front remains stalled.

Indeed, al Qaeda and its associates may well be betting that the French will eventually pull out of Mali. If they do, Mali and the region are likely to slide back to where they were before the French intervened in 2013 — home to a large terrorist safe-haven that increasingly attracts adherents from elsewhere in the world.

Preventing this scenario should be a priority. The French thus need and deserve all the help they can get from the United States and their European partners. Supporting French efforts today may not be an easy sell. But the alternative may well be intervening there again — perhaps without French help — five years from now.

Christopher S. Chivvis is associate director of the International Security and Defense Policy Center at the non-profit, non-partisan RAND Corporation and author of The French War on Al Qa'ida in Africa, published by Cambridge University Press in 2015. He also teaches European Security at the Johns Hopkins School of Advanced International Studies (SAIS).

This commentary originally appeared on The Cipher Brief on January 12, 2017. Commentary gives RAND researchers a platform to convey insights based on their professional expertise and often on their peer-reviewed research and analysis.