Libya is a country awakening from a nightmare, but it's not over yet. Qaddafi may no longer rule over the country with his eccentric yet brutal reign of terror, but the country is deeply divided, not in two, but rather into as many fiefdoms as there are armed militias. It's difficult to see from where true peace will come, but if the number of Libyans who turn out to vote is any indication, they haven't quite given up hope yet.

One Country, Many Militias

In the west, militias from Zintan and Misrata each control large swathes of territory and refuse to recognise the elected governments. In the east, around Benghazi, renegade General Khalifa Haftar battles militant Islamists in a devastating turf war that has destroyed large parts of Libya's second city. Into the power vacuum has stepped the so-called Islamic State, including many battle-hardened veterans of the war in Syria and Iraq; for a time they controlled Derna and Sirt. And all the while, rival governments – one in Tripoli backed by the UN as a unity government, one in Tobruk voted to power in earlier elections – claim to be the rightful administration. In the short term, Libya's future looks bleak. The path to a peaceful future is a complicated one that must resolve or remove at least two major roadblocks: the ongoing power of armed militias and the difficulties of the government – whoever that may be – in asserting effective control over the country.

Governing Libya

When Qaddafi was finally overthrown in 2011 and the militias need for bloodletting was, at last, sated, the country faced an altogether more complicated task: how to build a system of good governance. It was a task made even more difficult by just how divided the country was, not to mention the fact that whoever stepped into the breach would be starting from scratch. Colonel Qaddafi had ruled over Libya as if it were his own private estate and – the eccentricities of his system of government aside – he had done nothing to build a durable system of government that could outlive him. It was perhaps, therefore, too much to hope for that Libya would emerge from all the fighting and begin to rebuild the nation in a peaceful and democratic manner. Even so, Libyans are increasingly impatient that those who claimed to be fighting for a united Libya – two rival national governments and countless local militias – continue to divide the country between them, and that no-one has emerged to rise above it all and begin the near-impossible task of governing.

The Role of Islam

As happened so often in the aftermath of the Arab Spring, it was to the reassuring role of Islam that many Libyans turned amid the chaos. In early elections, particularly in Tripoli, Islamists won widespread popular support – for all the suppression of militant Islam under Qaddafi, Islam remained central to people's lives and mosques were among the few functioning institutions left in the country. Libyan Islam has always been dominated by a relatively tolerant interpretation of the Quran, and the Islamists, well placed to bring some much-needed stability, had little to do with the foreign fighters of the so-called Islamic State that would occupy Derna and Sirt in the years that followed. At the same time, numerous liberal or secular intellectuals and Western-oriented Libyan businesspeople returned to Libya in the aftermath of the war, hoping to rebuild the country. These two emergent strands of Libyan life represent nothing less than the struggle for the future of Libya – secular or Islamic, liberal or conservative. Expect it to take some time and numerous false starts before things become clearer.

Retribution or Reconciliation?

Whatever people thought of Colonel Qaddafi, it was difficult not to find his final moments deeply disturbing. Then one by one, the colonel's sons and senior lieutenants were captured or returned to the country, there to face justice far from the international spotlight. While it may be inevitable given the suffering inflicted on ordinary Libyans during Qaddafi's rule - including mass arrests, tens of thousands of political prisoners and a complete absence of political freedoms - it all seemed a far cry from some South African–style Truth and Reconciliation Commission. Just as importantly, serious questions remain about the fairness of legal proceedings and the treatment of prisoners in the new Libya. Of perhaps more enduring concern is the role – or rather the exclusion – of former employees in the Colonel's government. By one estimate, the Libyan state once employed half of all Libyan workers – it was, for decades the only game in town. To exclude even low-level employees from any future role in building the country could set a dangerous precedent and provide yet another flashpoint of conflict in a country with no need any further sources of division.