LONDON (Reuters) - Jockeying for power among Libya's well-armed and fractious new leadership may intensify after the death of Muammar Gaddafi, an anxious and, for many, joyous moment in a country hungry for stability and impatient to swap the bullet for the ballot box.
The interim government will be determined to ensure that lingering pro-Gaddafi forces are prevented from launching any rearguard guerrilla insurgency from the countryside that could destabilise the north African OPEC member and its oil industry.
Gaddafi's death is expected to allow Libya to start earning money again by selling its oil on world markets as a more benign security environment allows oilfield staff to get back to work.
But perhaps the most important test for the interim National Transitional Council will be to manage the enormous expectations of Libya's 6 million people, now freed definitively from the fear that Gaddafi could ever reimpose his long strongman rule.
"There is now this massive expectation. Up to now they've had an excuse that they are running a war. They don't have that now...Everything now has got to happen," John Hamilton, a Libya expert at Cross Border Information, told Reuters.
"That's a hard task. They have to deliver for the people ... On the other hand, this may renew the honeymoon they enjoyed when Tripoli fell, if they can put a decent government together in a short time."
The news of Gaddafi's capture and killing came minutes after reports that his home town Sirte had fallen amid raids by NATO warplanes, extinguishing the last significant resistance by loyalist forces.
HUGE TASK AHEAD
The capture of Sirte and the death of Gaddafi means Libya's ruling NTC should now begin the task of forging a new democratic system which it had said it would get under way after the city, built as a showpiece for Gaddafi's rule, had fallen.
An announcement that the country has achieved "liberation" is expected on Saturday, setting in motion a transition to democratic elections.
Some fear instability may linger and unsettle that process.
"Gaddafi is now a martyr and thus can become the rallying point for irredentist or tribal violence -- perhaps not in the immediate future but in the medium-to-long term," said George Joffe, a north Africa expert at Cambridge University.
"The fact that NATO can be blamed for his death is worrying, in terms of regional support, and may undermine the legitimacy of the National Transitional Council."
But the interim NTC authorities are also faced with a possibly more critical task, namely getting under control a clutch of anti-Gaddafi armed militias competing, so far peacefully, for ample share of funding and political representation in a post-Gaddafi Libya.
Libya expert Alex Warren, of Frontier MEA, a Middle East and north Africa research and advisory firm, said the death of Gaddafi "is clearly a momentous event and far more than just a symbolic one."
But he added, of the NTC militias: "These groups need to be either carefully disbanded or integrated into the armed forces ... Questions remain about who these militias answer to, how they manage their relationships with each other and what their demands are."
Under rules drawn up by revolutionary forces who overthrew Gaddafi in September, the fall of Sirte will lead to an official declaration that Libya is liberated, which will set in motion a process towards democratic elections.
On declaring liberation, the NTC will move its headquarters from Benghazi to Tripoli and form a transitional government within 30 days. A 200-member national conference is to be elected within 240 days, and this will appoint a prime minister a month later who will nominate his government.
The national conference is to be given deadlines to oversee the drafting of a new constitution and the holding of elections for a parliament.
Some worry that the politicking involved in forming a new government in the coming days may strain to the limit the alliance of convenience between provincial forces that constituted the armed opposition to Gaddafi.
Now he is gone, the glue that held the alliance together may fade.
Warren said it was not clear whether the current NTC chairman Mustafa Abdel Jalil, widely seen as the most widely supported politician in the NTC, would step down or not.
"In the current absence of any other organised political institutions, it is vital that there is leadership to oversee crucial elements of the transition, including the licensing of political parties, the organisation of elections, and the disbanding or reintegration of militias," he said.
In recent weeks Tripoli has seen an apparent competition for the title of top militia in the capital, where the many armed groups now exercising authority in the city portrayed themselves as the sole legitimate security force.
U.S. Republican Senator John McCain called on the NTC during a visit to Libya last month to move quickly to get the armed groups under their control.
"This is an end of one era but the fight over the new government has started already," said Ali Abdullatif Ahmida, a Libyan political scientist at the University of New England.
"It all depends on how the NTC leadership heals the country and reconciles people ... or takes revenge and settles scores. That may be a dangerous road."
(Editing by Sonya Hepinstall)