He was once known for his drinking habits, his stylish mustache, and his serial womanizing. Over the course of his colorful career he has served as a diplomat, a rebel chieftain, and a negotiator with al Qaeda hostage-takers. Today, however, Iyad Ag Ghali — known within his community as the "Lion of the Desert" — is winning new notoriety as a militant commander and Islamist powerbroker in a strategically sensitive corner of North Africa.

His prominence is likely to increase in the months to come. The rebellion in northern Mali that began earlier this year, fueled by loose weapons from the revolution in neighboring Libya, has morphed over the past few months from an ethnic separatist conflict to one increasingly dominated by Ansar Dine, the radical Islamist movement led by Ag Ghali — raising the possibility that the breakaway region could become a new jihadist safe haven and a lingering source of instability across northern Africa.

French President François Hollande has engineered a U.N. vote to consider intervention in Mali, and his defense minister, Jean-Yves Le Drian, recently said it was "a matter of weeks" before military action. Washington has given its blessing to military involvement by a regional grouping of African states eager to staunch the possible side effects radiating out from Ansar Dine’s new mini-state. And there’s even been talk that the Obama Administration might launch drone strikes against members of Al Qaeda in the Islamic Maghreb (AQIM), a group that has sought refuge with the Islamists in northern Mali and which has been linked by U.S. officials with the attack that killed U.S. diplomat Christopher Stevens last month in Libya.

Much of what happens next will depend crucially on Ag Ghali’s skills as a politician and a military leader. In recent months he has put his talents on ample display, stunning regional observers by engineering a convincing political and military victory over his erstwhile allies, the National Movement for the Liberation of Azawad (MNLA), the latest manifestation of a long line of rebel groups that have violently agitated for independence for the ethnic Tuaregs of the northern part of the country. While Tuaregs share Muslim beliefs with other Malians, the MNLA was never distinguished by religious militancy — in stark contrast to Ansar Dine, which aims for the unification of Mali under Islam and sharia law. By contrast, the MNLA has committed itself to a secular independent state it calls Azawad (a word that translates as "Land of the Nomads") and opposition to Islamic groups operating in the North.

Ag Ghali has already begun to realize his dream of imposing sharia law. Music, TV, and smoking have all been banned in the areas under his control, and Ansar Dine troops have been punishing women for not covering up properly. The group’s members have drawn up lists of unwed mothers and offering couples money to get married. Those who don’t comply with their demands face harassment, torture, or execution. In the town of Aguelhok, a man and woman were recently stoned to death for adultery. In Gao a young man had his hand chopped off for stealing. And in the fabled city of Timbuktu, Ansar Dine units have demolished various ancient Sufi tombs — part of a UNESCO world heritage site that is nonetheless derided by ultraconservative Muslims as a symbol of unorthodox belief.

Ansar Dine’s ascendance is fueling worries in the West about the possibility of a new Islamist nexus in a part of the world that had long seemed dependably stable. For two decades Mali has enjoyed a reputation as a successful Muslim democracy, a status rewarded by the U.S. and other western donors with generous supplies of aid. But there was one source of potential trouble: The large and restive Tuareg population in the country’s arid North, who have launched a series of haphazard revolts over the years, citing oppression and discrimination. During famines, for example, the central government looted funds for aid and resettlement camps, fueling anger amongst the Tuareg communities (often known locally as the "blue people," thanks to the indigo headscarves often wear, sometimes staining their skin the same color).

Many of the Tuaregs moved to Libya to escape drought and economic underdevelopment in their desert homeland; some of them even found jobs in the Libyan military. As it happened, the fall of Muammar Qaddafi last year gave fresh impetus to Tuareg separatists. As they watched Qaddafi’s regime near its end, leaders from previous rebellions began plotting to return to Mali, now bolstered by cars and heavy weapons believed to have been largely swiped from Libyan government arsenals. Having formed the MNLA, which incorporated various Tuareg groups from around the region, the rebels launched an offensive and quickly took several major cities in the North.

Ag Ghali, who had been the instigator of a previous rebellion in 1990, quickly spotted an opportunity. At a meeting of rebel leaders last October, Ag Ghali offered himself as a leader of the MNLA. But the Tuareg leaders rejected him on the grounds of his increasingly ardent Islamist beliefs. "We want to be a secular group," MNLA spokesman Moussa Ag Acharatouman told me at the time. "Ag Ghali’s desire to impose sharia does not fit the wishes of the people or the goals of the MNLA."

The leaders of the group have since had ample reason to regret their decision. Just weeks after they rejected him, Ag Ghali moved to announce the creation of his own group, which he dubbed Ansar Dine, or "Defenders of the Faith." Ag Ghali declared — to the dismay of MNLA leaders — that his group’s main goal was the establishment of sharia law across Mali. The nationalist leaders suddenly found themselves outflanked. "We knew that with Ag Ghali, a famous Tuareg leader, running around shouting about sharia law and welcoming Islamists into the region, we had no hope," said one MNLA commander at the time, wishing to remain anonymous due to his physical proximity to Ansar Dine units.

This time the Tuareg revolt got off to a blazing start. The separatists took town after town with barely a fight; Ansar Dine and AQIM forces helped to push out the Malian troops. The Tuaregs’ rapid success ultimately even triggered a military coup in the South, where disgruntled officers, enraged by the government’s failure to support their efforts to quash their rebellion, toppled the civilian government in the capital of Bamako. Ironically, considering the plotters’ expressed intent to maintain Mali’s national integrity, their move ended up accelerating the Tuareg takeover of the North. Although barely in control of the region, the rebels’ political wing announced the creation of the new state of Azawad on April 6. The declaration was aimed at trying to steal some of the thunder from Ag Ghali’s group.

The leader of Ansar Dine wasn’t prepared to let it go at that. He welcomed in Islamists from around the region, and, with Mali’s borders unguarded by Malian troops, they began to flock to the North. The ranks of Ansar Dine, which had begun with just a few hundred troops, quickly swelled — and the MNLA found its power slipping away. "One moment we were in control of everything," one MNLA fighter told me. "We thought this was it, this is set to be the most successful rebellion yet. Then suddenly it all went completely wrong. It’s heartbreaking." The MNLA discovered that it didn’t have enough troops to control all the territory it had captured. Ansar Dine began following it into captured towns, where they raised the black flag of the group and announced that they were in control.

For many, Ag Ghali’s metamorphosis into a fervent defender of the faith came as a surprise. For years, locals say, he was well known for his love of women and alcohol. Chana Takiou, the chief editor of the Malian newspaper 22 Septembre, says that during Ag Ghali’s earlier years he was well known for frequenting bars and drinking the night away. "He is shy, not very talkative, and rarely laughs," Takiou told me, though noting that Ag Ghali often prayed. He also recalls that Ag Ghali guarded his privacy.

Born in Kidal, a member of the Ifoghas clan, Ag Ghali was the son of nomadic stock farmer. During the 1980s, when he was still in his early twenties, Ag Ghali traveled to Libya, where he joined Qaddafi’s Islamic Legion, a group of fighters recruited to defend Islamic causes (and bolster Qaddafi’s religious credentials in the process). Ag Ghali was sent to fight against Christian militias in Lebanon.

After the legion was dismantled in 1987, Ag Ghali found himself back in Mali, now with a newly acquired taste for rebellion. On June 28, 1990, he launched the previously mentioned attack on the town of Menaka in the North, killing several Malian police and inspiring the first of many Tuareg revolts. Six months later, however, after intervention by the government of neighboring Algeria, he was pushed into signing a peace agreement without having attained any of his goals. Many of his supporters derided him for selling out, and accused him of stopping the rebellion just as it was getting under way.

Following the 1990 rebellion and a trip to Pakistan, Ag Ghali is reported to have become involved with the Dawa fundamentalist sect, an offshoot of the South Asia-based Islamic missionary association Jamaat al-Tabligh. He is said to have spent increasing amounts of time in mosques, and distanced himself from his previous social circles. Takiou, the Malian journalist, says that was the period when Ag Ghali became more of a hard-line Islamist. "He was spending time with a particular Pakistani preacher called Peshawar, who brought the Dawa movement to Kidal," says Takiou.

Mohammed Sylla, a member of the Dawa movement, who claims to have known Ag Ghali, tells me that he did not appear particularly militant, and was very friendly to all the members. "When some of our members realized he was going to take a rebel initiative, we tried to discourage him," says Sylla. "Our aim is not to attack any one or any country. We are friendly. Ansar Dine has nothing to do with the Dawa movement and we do not understand his objective or his vision." Sylla says that the members of the group "have no idea" why their former adherent embarked on his present path.

It was in 2003 that Ag Ghali began to make public statements of his following adherence to the fundamentalist cause (though he took care to reject terrorism and suicide bombings). He was chosen to be the government’s intermediary to negotiate the release of hostages held by the Islamic Salafist Group for Preaching and Combat (GSPC), the primarily Algerian militant organization that has since changed its name to Al Qaeda in the Maghreb (AQIM). His most significant success came in August 2003, when he negotiated the release of European tourists kidnapped in Algeria and held by Abou Zeid, a GSPC commander.

He has since been involved in a number of other negotiations with the group, sometimes accepting large commissions for his work, which has also brought him a reputation as a powerbroker. In 2006 he became involved again in plans for rebellion, contacting a veteran rebel Tuareg leader with who he started yet another uprising. Yet again, though, to the dismay of countless Tuareg separatists, Ag Ghali once again took the lead in negotiating a peace deal with the Malian government.

In 2007, as described by a leaked State Department cable, he even paid a visit to the U.S. embassy in Bamako, where he met with then-U.S. Ambassador Terence McCulley. "Soft-spoken and reserved, [A]g Ghali showed nothing of the cold-blooded warrior persona created by the Malian press," the cable notes. It also said that the "seemingly tired" Ag Ghali requested U.S. military assistance for special operations against AQIM. Despite his current efforts to impose sharia law, Ag Ghali admitted to the U.S. ambassador that "one of AQIM’s weak points was that not many people in northern Mali buy into its extremist ideology." His ability to play off different sides against each other has long been one of his most famous traits, and has helped to accentuate the air of mystery that he has cultivated around himself.

Small wonder, then, that the Malian government was happy to get him out of the way. In 2007, after he told authorities he was fed up with the problems of the North and requested to leave Mali, the government gave him a job as a consular official and dispatched him to Mali’s embassy in Saudi Arabia, though without giving him any real diplomatic responsibilities. The government in Riyadh eventually expelled him, accusing him of cultivating contacts with extremist groups. When he returned home, Ag Ghali spent even more time in mosques and grew his beard even longer, though his political motives remained opaque.

Ag Ghali’s group has rejected repeated requests for an interview, informing me that he does not wish to receive non-Muslim journalists. While there has been some debate about the sincerity of his religious zeal, analysts note an increasingly radical tone emanating from Ansar Dine over the past few months (as well as from Ag Ghali’s own statements).

According to Tinegoum Maiga, the director of the Bamako newspaper La Nouvelle République, Ag Ghali’s stress on the imposition of sharia law is motivated above all by a desire to secure financing. "He just wants to make a safe territory for himself, and so he uses sharia law to justify his donors sending him funding," explained Maiga, who claims that Qatar has been subsidizing the group. Maiga also explained that Algeria has a very strong relationship with Ag Ghali and has funded several of his operations for years. "He is very impressed with his new role as spiritual guide, coupled with warlord," says Maiga.

After meeting Ag Ghali in the northern town of Kidal in June, Malian journalist Adama Diarra told me that the Ansar Dine leader appeared deeply committed to his goal of implementing Islamic law. Diarra says that Ag Ghali depicted his aims as modest, and claimed that he merely wished to unify all Malians around their common Islamic heritage. But he says that Ag Ghali also declared anyone who refused to fight under the black flag of his group as "our enemy," and denounced secularism as "rubbish." "Whoever is working with secularism is our enemy and we will fight against them by all means," the warlord declared, according to Diarra. Ag Ghali also went on to demand that Mali should prove its democratic bona fides by holding a referendum allowing the Malian people to vote on the implementation of sharia law.

While Ag Ghali’s relationship with the MNLA seems to have waned, and with most MNLA units either fleeing to the border areas or joining Ansar Dine’s ranks, he has continued to build a strong network of Islamists in the region. Following the sightings of AQIM leaders around Timbuktu in April, members of the Movement for Unity and Jihad in West Africa (MUJWA) also began to operate in the region. Although closely allied with AQIM, MUJWA is a jihadi group controlled by black Africans with an operational focus on the countries of West Africa.

In recent months, though, the lines between these Islamist groups has increasingly blurred. Oumar Ould Hamaha, previously a senior member of AQIM, recently began describing himself as an Ansar Dine commander. While AQIM has long operated in the region, this is the first time its leaders have openly appeared in public. In addition to his role as a negotiator, Ag Ghali is also closely linked to the group through a cousin who serves as one of its officers.

The MNLA leadership spent months demanding that Ag Ghali denounce the Islamist groups. But those hopes were dashed when MUJWA fighters clashed with the Tuareg nationalists on June 27. The head of the MNLA, Bilal Ag Acherif, was injured in the fighting and taken to Burkino Faso for treatment; he is yet to return to Mali. Soon after the event, Abu Omar, a senior member of Ansar Dine, sounded unrepentant. "If you want to know if we are in conflict with MNLA, just bear in mind we do not have the same goals," Omar told me. "We will not fight against those who want to make Islam the winner." He explained that Mali has long been dominated by "satanic policies" such as open access to alcohol, prostitution, non-Islamic banking, and tolerance of stark inequalities of wealth as well as "so-called democracy." "We will not go back to the kind of system that God helped us to destroy," Omar told me. Meanwhile, Tuareg sources say that Ag Ghali is pushing the remnants of the MNLA into joining Ansar Dine, threatening attacks if they don’t merge with his group.

Local sources say fighters from Senegal, Pakistan, Nigeria, Afghanistan, Yemen, and Somalia, are arriving in northern Mali and attending Islamist training camps. Just last month MUJWA reinforced their rule in the town of Douentza, pushing the boundary of Islamist-controlled territory even further south and raising alarms in Bamako. Already some are beginning to worry that Ansar Dine and its allies could start to launch terrorist attacks in other countries of the region. Such concerns are prompting members of the regional grouping of West African countries, the Economic Community of West African States (ECOWAS), to consider calls for intervention. Responding to these moves, Ansar Dine spokesman Hamaha recently said: "We will conduct a war against all state members of ECOWAS and also France and the United States of America, the European Union which are supporting ECOWAS. We are ready to die for it."

The gravity of the situation has the attention of policymakers in the West, in Paris as well as Washington. The Malian government and ECOWAS military advisers are drawing up military plans for submission to the United Nations by a late November deadline. Those plans are likely to follow the model of the military intervention in Somalia by East African countries organized and supported by the West.

Talks between ECOWAS and Ansar Dine have so far brought little progress. When ECOWAS asked Ag Ghali to separate himself from "foreign" Islamist groups, he responded with fresh calls for the implementation of sharia. Malian Islamic officials have contacted the Ansar Dine leader to sound out possibilities for implementing some version of Islamic law, but it could already be too late for a peaceful solution. As his enemies marshal their forces, the enigmatic Ag Ghali will soon be forced to show his true colors. Either he will have to find an exit plan that plays to his well-versed strengths as a mediator or to go all the way in the fight for his religious beliefs.