With Colonel Muammar Gaddafi's 42-year rule over Libya seemingly at an end, the onus rests with the National Transitional Council to first stabilise and then reconstruct its infrastructure.
Building democratic states is complex and challenging at the best of times.
After violent conflict, this task is additionally complicated by the need for peace to be secured, institutions comprehensively reformed - if not built from scratch - and civil society and political culture reinvigorated.
Economies must also be put back on a path to sustainable growth. All these tasks are urgent, and success - or failure - across the state-building agenda is mutually reinforcing.
Sustainable peace, democracy and prosperity depend crucially on choosing the right institutions. But these cannot flourish without security.
For Libya, this means ending the violence caused by resistance from the old regime and quickly ensuring law and order are restored, weapons collected, and rebels demobilised and reintegrated.
Need for justice
In the medium term, reforms need to establish full democratic control over all armed and other security forces.
As the new government assumes responsibility for running the country, a functioning system of law and order needs to be established.
This requires mechanisms to investigate and prosecute crimes committed by the Gaddafi regime and to ensure that justice is also accessible to those who came to harm during the revolution, regardless of who the perpetrators were.
This will require a carefully balanced approach that is neither equivalent to wholesale criminalisation of Col Gaddafi's former supporters, nor a blanket amnesty.
As the National Transitional Council has already made clear, justice needs to enable reconciliation.
A stable, peaceful, democratic and prosperous Libya can only be built with international support, especially in the short-term.
Financial and technical assistance and restoration of government revenue sources, backed up by sound economic and fiscal policy, are crucial to rebuilding public finances, creating a climate in which economic growth can be fostered.
This gradually enables states recovering from conflict to become less aid-dependent and provide a range of public services that, in turn, contribute to greater legitimacy of their institutional framework.
Libya's oil wealth should make this task easier. But here, too, pitfalls exist.
As the haggling over Iraq's oil and gas law has demonstrated, managing resource wealth and sharing it fairly are demanding tasks that require balancing local and national interests with those of international individuals, states and corporations.
State-building also requires nation-building.
More precisely, the legitimacy of post-Gaddafi Libya will rest on its institutions' ability to facilitate the growth of a vibrant civil society, political culture and a truly independent media. This is necessary to inspire co-operation and trust between different segments of society.
The process can be facilitated by international actors but needs to be organic and bottom-up to succeed, with input from across society.
Any post-conflict state's capacity to provide security for its citizens determines its legitimacy.
Vice versa, the state's legitimacy - in terms of elections and decision-making processes - conditions whether its security is seen as providing protection or imposing a new regime.
A broad-based transitional government is required to prepare elections in which all political actors can participate and to contain those forces set on disrupting the democratic process.
All actors must agree to basic principles of political conduct, enshrined in institutions, and remain united against anyone violating this consensus.
Building a secure, stable, democratic and prosperous Libya will not be easy or quick.
Local leaders must realise this and explain the complexity of the task to constituents, while the international community has to muster the resources, stamina, and enthusiasm to support the process.
And if the institutions being built now establish inclusive, transparent and accountable government, then Libya might well turn into an example of successful democratic state-building.