THE UNITED STATES and its NATO allies took a big risk in Libya last year — not by supporting the rebellion against dictator Moammar Gaddafi but by doing little to help the victorious rebels with security after the war. Libya is now struggling to hold itself together as its various tribes and militia factions resist central authority; meanwhile, former Gaddafi fighters and weapons are spilling into neighboring countries.

The most severe trouble has erupted not in Libya but in neighboring Mali, a poor desert nation that had sustained a fragile democracy for more than two decades. Ethnic Tuareg fighters, many of whom were employed as mercenaries by the Gaddafi regime, streamed back across the border this year with abundant supplies of weapons. Sweeping across northern Mali, they have taken several large towns, including Timbuktu, and have declared their own republic — in effect partitioning the country.

The failure of the ill-equipped Malian army to stop the offensive in turn prompted a coup by junior officers in the capital, Bamako, on March 22. The rebels, led by 40-year-old Capt. Amadou Sanogo, speak vaguely of building a better army. But their revolt so far has merely enabled the Tuareg victories and caused chaos in the capital.

More than the fragile health of African democracy is at stake. Mali has become a transit point for drug trafficking to Europe, and an al-Qaeda branch, al-Qaeda in the Islamic Maghreb, is active. An al-Qaeda ally called Ansar Dine has been capitalizing on the Tuareg rebellion, sweeping into conquered towns, raising a black flag and announcing the imposition of sharia law. Hundreds of Christians living in Timbuktu were reportedly forced to flee the city.

The good news in this grim picture is that Mali’s West African neighbors have rallied — first to defend its democracy and now to turn back the Tuareg rebellion. On April 2, the Economic Community of West African States imposed heavy sanctions, including an economic blockade, on Mali, while demanding that the military coup be reversed. On Thursday, defense ministers of the 15 nations were meeting in Ivory Coast to consider a military intervention aimed at both the rebel officers and the Tuareg separatists.

France, which led the NATO intervention in Libya and employed its troops to defend democracy in Ivory Coast last year, appears ready to assist the possible intervention, at least logistically. Paris, as well as its NATO partners, should perceive a moral obligation, as well as a tangible national security interest, in restoring Mali’s previous order. The West should not allow its intervention in Libya to lead to the destruction of democracy — and entrenchment of Islamic militants — in a neighboring state.