[Published in The Independent on 1 September 2011.]

There are many pitfalls ahead for Libya, a good number of them beyond the control of the incoming transitional government and the international community. The country is in flux. In many cases, good local leadership and effective diplomacy will help to smooth the way. But the challenges are nonetheless significant.

To begin with, Libya needs the institutions that would enable the Transitional National Council (TNC) to get the country functioning again. For that to happen the TNC will need to extend its control across the whole country, and to defeat or at least contain the resistance that the old regime is still offering.

This will, of course, take some time. But establishing security, law and order, especially in the crucial urban areas where the majority of the population is concentrated and which have seen the heaviest fighting, is a task at which the TNC is already working, and with some success at that.

Much of what the TNC will need to do to make that happen is uncertain. Their ultimate success in mopping up the remnants of the old regime seems likely, and with the continued assistance of Nato, will probably not leave much spirit or many resources at the hands of Gaddafi loyalists.

But unless the dictator and his inner circle are caught, unless financial and material supply routes are comprehensively cut off, there is a danger of at least a prolonged low-level insurgency. The Taliban recovered from their defeat in 2001 and the Sunni insurgency in Iraq gathered intensity long after the capture and execution of Saddam Hussein.

We have not seen so far the widespread looting and reprisals that often occurs in the course, and immediate aftermath, of violent regime transitions. But if the humanitarian situation worsens, if essential public services are not resumed quickly, the security situation may deteriorate, and looting and reprisals may escalate. Whether such a vicious circle will indeed follow depends not only on how effectively the TNC can assert control as a government, but also on how much the different factions can keep their own supporters in check.

Managing relations within the TNC and between the TNC and Libyan population will be hard enough in itself. But it is essential if the new government is to retain broad regional and international support, particularly to get access to Libyan assets abroad and tap into the current international goodwill to address immediate humanitarian needs and the longer-term reconstruction task.

Rival rebel factions will all be vying for the spoils of victory. And as evidence emerges of regime atrocities, national reconciliation will be very hard without a proper sense of a peace dividend. Leaders and followers alike will need to sense that they are better off not only without Gaddafi but also by refraining from seeking to resolve disputes by violence rather than politics, even if that means uncomfortable concessions and compromises.

The existence of a draft constitutional charter, with its concern for inclusive institutions, goes someway towards soothing those concerns. But it leaves a level of discomfort when it determines Islam as state religion and sharia as the principal source of legislation. Elections and the process of drafting a permanent constitution will eventually give the Libyan people a clear say in what kind of new Libya they wish to live in, but it may yet be a far cry from what many Western supporters of the revolution and Nato’s involvement envisioned.