analysisBy Simon Allison
Last week, Libya's House of Representatives (representing who, exactly, in Libya's fractured polity?) elected a new president.
Aguila Saleh Iissa, an independent lawmaker from the eastern town of al-Qobba, is the country's sixth head of state since the fall of Muammar Gaddafi.
That's an average of one new leader every six months: not exactly a stellar record for Libya's post-revolutionary government. Worse, it's symptomatic of a broader lack of control.
Without an army or effective civil service to exert its authority, the government has been relying on a hodgepodge of local militia groups to guard key institutions and to keep itself in nominal power.
Unsurprisingly, this has proved an unreliable foundation on which to construct a new state: and it's already falling apart.
In July, tensions between rival militias in Tripoli exploded into an all-out battle for possession of the capital's airport. The airport is now unusable. At the same time, in the influential eastern city of Benghazi, a radical Islamist group was battling it out with a renegade army general.
'Out of control,' was The Economist's verdict, and it was all too much for many of the foreigners working in Libya, and most of the diplomatic corps - including the American embassy, who evacuated the country in a hurry.
Since then, things have gone from bad to worse. While the fighting in Tripoli continues, those Islamist radicals succeeded in occupying Benghazi. And they didn't just occupy it. Just a few days before President Iissa was appointed, armed Islamist group Ansar al-Sharia in Libya declared the creation of an 'Islamic Emirate' with Benghazi as its capital, effectively seceding from the Libyan state - which can do absolutely nothing about it.
There are unmistakeable echoes here of the recent establishment of 'the Islamic State' across northern Iraq and parts of Syria, by the Islamist group that now calls itself by the same name. This is no coincidence.
It's not just that both the Islamic State (formerly known as the Islamic State in Iraq and Syria, or ISIS) and Ansar al-Sharia have taken advantage of weak or non-existent governance to assert their own sovereignty, although this is certainly true.
The link between the two is even more direct. Ansar al-Sharia may not have formally pledged bay'at (allegiance) to the Islamic State and the global caliphate it seeks to impose, but it has done pretty much everything else - including sending fighters to the battlefields in Iraq and Syria.
Research from the Terrorism Research and Analysis Consortium (TRAC) indicates that the Islamic State returned the favour, actually sending fighters of Libyan origin - now trained and battle hardened - to assist Ansar al-Sharia in taking Benghazi. It was shortly after this decision was reached, on 22 July 2014, that the fighting in Benghazi intensified.
'Ansar al-Sharia in Libya is an important ally for the Islamic State in expanding its presence and influence into Maghreb countries,' said Jasmine Opperman, a TRAC director. 'Such an alliance will allow the Islamic State to influence and direct the establishment of a smaller Islamic caliphate in Libya as a first step in expanding it into the Maghreb.'
Not all locals welcomed the new Islamic Emirate of Benghazi; many participated in an opposition march to protest their new political reality. But this was swiftly countered by a rally in support of the Islamists - although this didn't attract quite as many people. Aware of this, the group has acted swiftly to implement its dawa (missionary) programme, which includes basic service provision and elements of welfare.
As far as armed opposition goes, this comes from former Libyan General Khalifa Haftar and his Operation Dignity, which has divided what remains of the Libyan army into two: those still answering to the government, and those who support Haftar's anti-Islamist and anti-government initiative (described by the government in May as an attempted coup d'état).
However, Haftar's forces have so far been unable to challenge Ansar al-Sharia's superiority around Benghazi, and seem to have lost momentum in the wake of the declaration of the Islamic Emirate. The general himself was recently forced to deny that he had fled, tail between his legs, across the border to Egypt.
In some ways, the conflict in Benghazi mirrors broader struggles in the region between Islamist groups (both those which are democratically inclined, and those which are not) and hard-line military figures in the mould of the dictators who were ousted during the Arab Spring.
Unlike in Egypt, however, where the military definitely has the upper hand, in Libya it looks like the radical Islamists are in the strongest position to realise their goals. This is bad news for Libyans hoping that the 2011 revolution would usher in a new, democratic dispensation.
The apparent disintegration of the Libyan state also raises important questions for supporters of the European-led military intervention in 2011. Specifically, had enough been done to help Libya fill that massive, Gaddafi-shaped hole?
'The major political agenda of the military intervention was the removal of Gaddafi's government, which was not accompanied by an effective political framework that adequately considered the post-conflict challenges facing post-Gaddafi Libya,' said Solomon Ayele Dersso, a senior researcher at the Institute for Security Studies in Addis Ababa.
'The lack of safeguarding, at the time, of the military intervention to secure the large number of weapons in government military depots left the country with diverse armed militias pursuing their own individual agendas.'
Dersso concludes that the international community should have done more. 'Soon after the fall of Gaddafi, the difficult task of putting Libya back together was largely left to the new political and military forces and there has been a very "light" level of international engagement. There should have been a robust international engagement early on for reforming and rebuilding the security and justice sectors, implementing disarmament and facilitating national dialogue and reconciliation,' he said.
In the absence of effective peacebuilding, Libya is fragmenting. Pity poor President Iissa - he may be head of state, but will there even be a Libyan state for that much longer?