The deadly attack on the In Amenas gas facility in southern Algeria could herald a power struggle within al Qaeda in the Islamic Maghreb, or AQIM, which is fast becoming one of the most dangerous branches of the organization.
The attack was claimed by veteran Algerian jihadist Moktar Belmoktar, who last year was forced out of AQIM's leadership by its emir, Abdelmalek Droukdel. Their rivalry has been aggravated by geographic distance, disagreement over jihadist doctrine, and - above all - personal ambition. At one point, Droukdel tried to have Belmoktar assassinated, a former jihadist from the region told CNN.
The rift between them not only led Belmoktar to mastermind one of the most serious terrorist attacks in North Africa in years, but may also dictate the future course of jihad in the region, the sources say.
In September, Droukdel "fired" Belmoktar from the AQIM leadership, and he responded by setting up what one of his close associates described as a new trans-Saharan franchise of al Qaeda. Nearly all the men under his command were said to have followed Belmoktar out of AQIM.
In December, Belmoktar announced the formation of a new commando unit called "We Sign with Blood," and he promised attacks against Western interests in the region and the home soil of Western countries if an operation was launched against jihadists in northern Mali.
The name of the new commando unit was first used by a unit of an Algerian militant outfit that hijacked a French airliner in 1994, according to Camille Tawil, a Lebanese expert on al Qaeda.
"It is possible (Belmoktar) is trying to assert his influence in the Sahara and is telling Droukdel that 'it's me who is the big leader of the AQIM cells in the Sahel region, and I report directly to Zawahiri and Mullah Omar and not to you,' " Tawil told CNN.
Ayman al-Zawahiri is al Qaeda's leader, and Mullah Mohammed Omar is the spiritual leader of the Taliban.
The two men are close in age: Droukdel was born in 1970 in Meftah, just south of Algiers, and Belmoktar in 1972 in central Algeria on the edge of the Sahara. Both fought for the Armed Islamic Group in Algeria's brutal civil war.
Belmoktar spent time in jihadist encampments in Afghanistan in the early 1990s, providing him with contacts to al Qaeda's senior leadership, according to experts on the group. He also spent time in Yemen.
Droukdel did not travel to Afghanistan. He first became involved in Islamist activism after high school, according to Andrew Lebovich a Senegal-based analyst.
Belmoktar and Droukdel later joined a new group - the Salafist Group for Preaching and Combat, or GSPC, which promised an end to massacres of civilians - for which the Armed Islamic Group had become notorious. Droukdel became the emir of the group in 2004, which did not sit well with Belmoktar.
Droukdel subsequently reached out to al Qaeda's senior leadership in Pakistan and rebranded the GSPC as al Qaeda in the Islamic Maghreb in 2007. Documents recovered from Osama bin Laden's Abbottabad compound revealed correspondence between the two leaderships.
Belmoktar appears to have taken a backseat role when, in 2007, AQIM launched a suicide bombing campaign in Algeria, which included a deadly bombing against the UN headquarters in Algiers.
There were persistent rumors that he was secretly negotiating a cessation of hostilities with Algerian authorities, allegations that he later strongly denied.
Belmoktar, then as now based in Mali, had by 2007 built a powerful base of operations in the sub-Saharan region. He burnished his jihadist credentials with an audacious raid against a Mauritanian military base in 2005 that killed 15 soldiers.
But he had also built a flourishing criminal enterprise based on smuggling and charging "transit fees" to drug traffickers transporting Latin American cocaine through West Africa to Europe. He had also emerged as a political wheeler-dealer, buying influence and favors with a web of power brokers in the sub-Sahara region.
According to Noman Benotman, a former Libyan jihadist once personally acquainted with al Qaeda's top leaders, including bin Laden and Zawahiri, Droukdel welcomed the flow of cash into the group but became concerned that his own leadership was under threat. Droukdel, he said, also developed theological objections to Belmoktar's criminal enterprises.
Benotman, who is now a senior analyst at the Quilliam Foundation in London, told CNN that in 2007, Droukdel planned to have Belmoktar killed unless he subordinated himself to his leadership.
Belmoktar was summoned to Droukdel's mountainous stronghold in Kabylie, east of Algiers, but refused to go, fearing a trap.
When Droukdel sent an envoy to Mali to replace Belmoktar as the group's top commander in the Sahara, he grudgingly accepted a demotion, Benotman said, ending Droukdel's plans to kill him. But analysts say he only ever paid lip service to the new hierarchy that was imposed.
Instead, he developed his own group of loyal fighters, known as "Al-Mulathameen," or "The Masked Ones." According to Jean-Pierre Filiu, a French expert on North African terrorist groups, Belmoktar burnished his global jihadist credentials by dispatching his men to carry out a drive-by shooting on the Israeli Embassy in Nouakchott, Mauritania's capital, in 2008 and orchestrating a failed suicide bombing on the French Embassy there the following year.
Droukdel, meanwhile, tried a strategy of divide and rule by promoting Abdel Hamid Abu Zeid, an Algerian jihadist with a reputation for extreme brutality, to lead a separate fighting force, or "katiba," in the Sahara.
With the fall of the Moammar Gadhafi's regime in Libya in 2011, Belmoktar's position strengthened significantly, because it triggered the takeover of northern Mali by Tuareg separatists and jihadists, creating a larger haven for his fighting group.
Belmoktar traveled to Libya, making contacts with Libyan militia and obtaining weapons from Gadhafi's stockpile for his group, according to regional security sources.
In contrast to Belmoktar, by 2012, Droukdel was becoming an increasingly marginalized figure in the global jihadist movement. Security operations by the Algerian military after the group's suicide bombing campaign significantly weakened the group and isolated it in he mountains east of Algiers.
In an effort to reassert control, Droukdel sent several envoys to northern Mali to remove him from the AQIM leadership altogether, according to Benotman. He told CNN that according to his sources, the envoys visited jihadist encampments in Gao, Kidal and Timbuktu, where they read out a letter from Droukdel making the announcement public.
Benotman told CNN that one of the triggers may have been annoyance with Belmoktar's unauthorized scouting and networking missions into Libya. According to regional security sources, another factor may have been that Belmoktar was planning attacks against Western interests without authorization.
A competition for Zawahiri's approval
Belmoktar now appears to have made a pitch to "al Qaeda central" with the In Amenas attack. In a video recorded during the standoff, he went out of his way to claim the attack on behalf of al Qaeda.
Belmoktar's demand during the siege for the release from U.S. prisons of Omar Abdul Rahman (the blind sheikh) and Aafia Siddiqi, two hugely popular figures in pro-al Qaeda circles, may have been a calculated effort to boost his popularity.
"Al Qaeda's stamp of approval to these guys means everything because without this, they have little legitimacy" Benotman told CNN. "Zawahiri and the top leadership will have to intervene and sort the problem out. Belmoktar is now a legend, so they'll have no choice but to hear him out," he said.
Tawil agrees, calling Belmoktar "the rising star among the Islamists in the Sahel."
He believes Zawahiri may try to resolve the dispute by installing him as the leader of a separate al Qaeda affiliate in the Sahara-Sahel region, but says this probably would not end their rivalry.
Tawil told CNN that Droukdel and Belmoktar may escalate their terrorist campaigns in North Africa and the Sahara to outbid each other in responding to the French military offensive in Mali.
"Both of them will be trying to prove that they are worthy of carrying the name "jihad," and they will try to do something in next days and months," he told CNN.
Belmoktar has become one of the top targets of Western intelligence services. According to a security source briefed by Western intelligence, French intelligence services have been targeting him for some time out of concern that he might organize attacks in France or try to bring down a civilian airplane with surface-to-air missiles looted from Gadhafi regime stockpiles.
Some say that such is the rivalry between the two men that Western intelligence services should think twice about targeting Belmoktar.
In a policy briefing published by the Quilliam Foundation on Monday, Benotman argued that "in order to create a self-defeating mechanism within AQIM itself, it would be highly effective to encourage and foster an already existing strong rivalry and disunity within the group."
But in the meantime, Belmoktar and Droukdel will no doubt be planning further operations against Western interests in North Africa.