The ignominious end of Col. Muammar Gaddafi may mark a milestone of liberation beyond the wildest dreams and prayers of his long-suffering people just a short year ago, but it also represents a huge headache for Libya’s fragile transitional rulers: Gone is the common enemy that bound together a diverse and often fractious coalition of contending tribal, regional and political power centers; the shot that killed Gaddafi was also the starting gun on a potentially perilous race for power in Libya.

Libya’s Transitional National Council was recognized as the country’s legitimate government by Western and Arab powers long before its legitimacy was an established fact among Libyans themselves, even among many of those bearing the brunt of the fighting against the regime. The Council has struggled, since the fall of Tripoli, to manage an increasingly rowdy post-Gaddafi political environment, with its leadership increasingly challenged by many of the fighting forces — organized on the basis of regional, tribal or Islamist political affinities — who see the group as too dominated by former Gaddafi officials, and deriving its authority from its relations with the West rather than support among Libyans. Indeed, in response to challenges to its legitimacy from within rebel ranks, the Council three weeks ago reiterated a previous pledge to take no part in the election it promised would be held eight months after victory was declared. With Gaddafi dead, the election clock is now ticking, and those currently in power have promised to exist stage left by next summer. Even before that, the transitional government that the NTC has vowed to create within 30 days of declaring victory will likely see an escalation of fierce political infighting among rival rebel factions.

Staging a democratic poll in just eight in a country with no contemporary history of party politics or the rule of law — and which is riven by tribal, regional and political schisms — is certainly a tall order. But challenges to the NTC’s legitimacy might make delaying the process difficult to countenance without a consensus among some of the rival factions now competing for power.

Only a day before Gaddafi’s death, interim prime minister Mahmoud Jibril told TIME he planned to resign this week, citing the emerging power struggle as his reason. “We have moved into a political struggle with no boundaries,” explained Jibril, a Western-trained technocrat without an obvious mass base. “The political struggle requires finances, organization, arms and ideologies. I am afraid I don’t have any of this.”

Jibril had become a lightning rod for mounting antagonism from the Islamist fighters of the Tripoli Military Council, and also of the militias of the city of Misrata who played a key military role in toppling Gaddafi and killing him. Those groups believe they were being shut out of decision-making by an alliance of Western-backed technocrats and former regime officials, and were vowing to fight back. Ali al-Sallabi, a prominent Islamist cleric and ally of Tripoli Military Council leader Abdel Hakim Belhadj, has openly condemned Jibril and demanded his resignation.

Jibril’s comment about lacking an ideology is telling: As as has been the case in Egypt and Tunisia, the Islamists have a natural advantage over many of the other groups who took up the fight against Gaddafi in that their political vision — in Libya’s case of a moderate Islamic democracy on friendly terms with the West — has no established ideological competitor with mass appeal. Many of the other groups who fought in the frontline were often organized on the basis of tribal or regional affinities, which offer little basis for national electoral appeal. But as TIME’s Abby Hauslohner as reported their role in taking down Gaddafi has boosted the claims of the rebels of Misrata, who feel sidelined by the NTC. For similar reasons, the claims for greater representation by the long marginalized Amazigh Berbers of the mountains West of Tripoli can’t be ignored.

Nor is there any simple answer to competing tribal and regional claims by devolving power, because the key question — in a country previously ruled by Gaddafi on the basis of tribal and regional patronage — is how the country’s oil wealth will be shared in a new order. (Iraq is still engaged in fierce political infighting over an oil law addressing that issue eight years after Saddam’s ouster.)

Jibril, in his comments to TIME, also warned that the situation was moving “from a national struggle to chaos,” and becoming a battleground for “all the foreign powers which have their own agendas towards Libya.” That was a clear reference to Qatar, whose strong backing for Islamist militias has drawn fierce criticism from the NTC. Qatar was the leading Arab supporter of the effort to oust Gaddafi, having agitated for Arab League authorization; been among the first to recognize the NTC and helping it sell oil on world markets; providing financial aid and weapons; and sending its own planes and special forces troops to join the war effort. But NTC officials have loudly criticized the Qataris for funneling aid and weapons directly to the Islamists, bypassing the authority of the Council. The political instability of post-Gaddafi Libya could be exacerbated by the intervention of foreign powers looking to burnish their own stake — it’s not yet clear to what extent these issues have been tackled in the various contact groups established by foreign backers of the rebellion against Gaddafi.

Even more vexing than managing the growing conflict among the stakeholders of the anti-Gaddafi resistance, is the challenge of integrating Gaddafi’s own, not insubstantial political support base into a new order. In those towns where his forces fought to the bitter end, such as Sirte and Bani Walid — and even in Tripoli — there was clearly a measure of popular support for Gaddafi among the civilian population. The potential for the outbreak of an insurgency was highlighted last weekend at a pro-Gaddafi protest in Tripoli that turned into a firefight with NTC-aligned security forces.

A number of far-sighted elements of Gaddafi’s regime crossed over to the rebellion early on, and some of those will now move to establish political parties to contest for power. The question of how the NTC accommodates elements of the old regime in the transition to a new order may determine its stability.

The experience of Iraq, and the debacle of the dissolution of the Iraqi military followed by “de-Baathification” policy that shut tens of thousands of Sunnis out of any stake in the post-Saddam order, suggests that Libyans can spare themselves a lot of blood and tears by moving quickly to hand a generous stake in the post-Gaddafi LIbya to those who backed the regime to its end. But in the clamor for power and payback in rebel ranks, that may be difficult. Indeed, it will take considerable political energy simply to restrain some of the more militant rebel elements from exacting revenge on supporters of the regime — and generating the hostility that would fuel any insurgency.

Disarming the militias or incorporating them into a new national army is clearly an overwhelming priority, as emphasized by Secretary of State Hillary Clinton on her visit to Tripoli earlier this week. But right now, those militias are the most important political leverage in the hands of some of the key political and regional forces contesting for power in the post-Gaddafi era. The very definition of statehood is a monopoly of military force under a single political authority, and the Libyans have set themselves the goal of achieving that, with political power based on the democratic will of the citizenry, within just eight months. Achieving that goal, on that timetable, would qualify as something of a political miracle. Then again, a year ago most Libyans would have said overthrowing Gaddafi would take a miracle, too.

Tony Karon is a senior editor at TIME, where he has covered international conflicts in the Middle East, Asia, and the Balkans since 1997. A native of South Africa, he now resides with his family in Brooklyn, New York.