One year since the anti-Kadhafi revolt erupted, Libya is battling challenges ranging from how to tame rowdy militias who fought his forces to establishing a new rule of law in the country.
On Friday, Libya marks the first anniversary of the revolution against Moamer Kadhafi, which was ignited in the eastern city of Benghazi on February 17 and ended on October 20 with the dictator's killing.
No official celebrations have been organised at a national level, but local councils are planning commemorations and have been warned to be on the alert against possible attacks by Kadhafi supporters.
"We need to be careful because some agents of Kadhafi's regime have dreams (of creating insecurity). But the thuwar (revolutionaries) are ready all the time to confront them firmly," warned Interior Minister Fawzi Abdelali.
Kadhafi's ouster and death was one of the key events of the so-called Arab Spring, but Libya has since struggled to erase the legacy of the former strongman's four decades of iron-fisted rule.
Thousands of people were killed or wounded in the struggle, the country's vital oil production ground to a halt, and homes, businesses, factories, schools and hospitals were devastated.
So Libya's new rulers face daunting challenges -- not only rebuilding an ageing infrastructure and repairing the damage, but also fostering vibrant state institutions, tackling a corrupt economy and boosting what are weak health, judicial and educational systems.
But their most immediate headache is how to control the tens of thousands of ex-rebels who helped oust Kadhafi and have now turned into powerful militias, whose jealously guarded commitment to their honour and power occasionally erupts into deadly clashes.
"By now they (militias) have developed vested interests they will be loath to relinquish," said World Bank advisor Hafed al-Ghwell in a recent report.
Ghwell said the militias have an edge over the nation's National Transitional Council (NTC) because of their "superior local knowledge and connections, strong leaderships and revolutionary legitimacy."
In the absence of a regular and efficient national army and police, the militias are providing security on the streets and even guarding installations such as airports.
But armed with light and heavy weapons these rival militias have emerged as the biggest security threat for Libya, regularly clashing with each other and causing fatalities.
Global human rights organisations Amnesty International, Human Rights Watch and Doctors Without Borders have lashed out at them, accusing them of torturing their prisoners, most of whom are former pro-Kadhafi fighters.
Signup to our newsletter and follow us on Facebook and Twitter!
"Revenge attacks against populations deemed to have supported Kadhafi also grew" in recent months, HRW said in its World Report 2012, particularly targeting militias from the city of western port city of Misrata.
It accused militias from Misrata of preventing about 30,000 people from returning to their homes in Tawarga, a nearby town.
The NTC is keen to integrate these militias into security services, but acknowledge that it is a tough task.
"This (disarming of militias) is a much more complex issue than it may sound," Prime Minister Abdel Rahim al-Kib recently told reporters.
In September, HRW called on the Libyan authorities to establish a judicial system capable of handling the situation of all prisoners.
In November, the NTC announced the adoption of a law on transitional justice but has failed to reveal its contents so far.
Ghwell said the NTC's desire to control the militias is understandable, but there are concerns about the ruling body itself.
"The NTC has had to struggle with internal divisions, a credibility deficit and questions surrounding its effectiveness," he said.
Within four months of the end of the conflict, the NTC suffered a severe blow after its number-two and former Kadhafi stalwart, Abdel Hafiz Ghoga, resigned after protests against him in Benghazi, the cradle of the uprising.
His belated defection from the previous regime angered protesters, who attacked the NTC offices in Benghazi with grenades, accusing the council of "non-transparency, stealing the revolution and allowing opportunists" of the old regime to be part of the new ruling team.
Faced with such stiff challenges, the NTC has put everything on hold until the election of the nation's first 200-member Constituent Assemby in June, including the awarding of new contracts to foreign companies for rebuilding the war-battered country.
"The heart of the matter is political. The security landscape’s fragmentation, and militias’ unwillingness to give up arms, reflects distrust and uncertainty regarding who has the legitimacy to lead during the transition," said Ghwell.
In a bid to boost its own credentials, the NTC adopted the nation's first new election law earlier this month, giving priority to women, youth and political parties to participate in the nation-building process.
"Libya's new leaders face an enormous challenge ... to build a country based on the rule of law after 42 years of one-family rule, while preventing revenge attacks ... and promoting reconciliation," HRW said.
"All these processes will take time and will require outside assistance. But the events of 2011 have given Libyans the opportunity to begin this arduous process."