MIRED in war, threatened by jihadists and short of cash—it is a wonder that anyone wants to rule Libya. Yet until recently the country had four competing governments. Rival administrations based in Tripoli, the capital in the west, and Beida, in the east, have spent the past two years fighting over a disputed election, among other things. That has allowed Islamic State (IS), the third contender, to grab roughly 180 miles (290km) of coastline around Sirte, in between them.

The jihadists’ advance hastened the creation last year of a fourth outfit, the Government of National Accord (GNA). It is the result of a UN-sponsored deal signed in Skhirat, Morocco, on December 17th by politicians from both sides of the country. But they did not have the backing of the warring parties. So despite Western support, when leaders of the new body left Tunisia for Tripoli on March 30th, they travelled by boat—for fear of being shot down.

The surprisingly smooth arrival of the prime minister, Fayez al-Serraj (pictured), and six others from the GNA’s nine-member presidency council has provided Libya with a glimmer of hope. Mr Serraj, a businessman with little political experience, has received pledges of support from several militias and municipalities. He now controls the state’s only functioning institutions: the national oil firm, Libya’s sovereign-wealth fund and its central bank, which welcomed the “start of a new era”.

The situation, though, is by no means settled, even in the west of the country. There is confusion about whether the old Tripoli government is standing down in favour of the new one. Mr Serraj and his colleagues are hunkered down at a heavily-guarded naval base while talks continue. Loyalties tend to be fickle. Even the militias supporting the GNA are doing so out of self-interest, says Anas El Gomati of the Sadeq Institute, a Libyan think-tank. The GNA can pay salaries and negotiate oil deals, so “it is the new game in town,” says Mr Gomati.  

Gluing a nation together again

Under the Skhirat agreement, members of the old Islamist-tinged parliament in Tripoli join a new advisory body called the State Council. But some feel the deal, which was not formally approved, lacks legitimacy. That view is shared in the east, where the internationally recognised House of Representatives (HOR), slated to become Libya’s legislature, has failed to secure the required supermajority in favour of the agreement.

European sanctions on foot-dragging leaders in the east and west are meant to speed the process, but they do not cover Khalifa Haftar, the Libyan army general who is waging a brutal campaign against “terrorists”—many of whom happen to be his opponents. Supported by foreign powers, such as Egypt and the UAE, General Haftar looms over the eastern government. Article 8 of the Skhirat agreement brings the army under the control of the new government: hated in Tripoli, General Haftar is likely to be sacked. So the HOR insists that the article be removed.

Some suggest a compromise whereby eastern Libya is given a measure of autonomy and its own regional army led by General Haftar, under a central command. But that might alienate the GNA’s supporters in Tripoli. And the general still seems to harbour national ambitions. One of his commanders promised this week to “clear out” Sirte—and then Tripoli and Misrata, home to dozens of militias.

The lack of unity is complicating efforts to defeat IS, which has some 5,000 fighters in Libya. Western powers hope the Skhirat agreement may eventually bring the country’s armed groups under a single command that could work with their forces. For now, though, the West is lining up friendly militias to battle the jihadists, while occasionally striking them from the air. This risks exacerbating divisions in the country. Everyone wants to be the peshmerga of Libya, says Mattia Toaldo of the European Council on Foreign Relations, a think-tank, referring to American-backed Kurdish fighters in Iraq. “The problem is that having several peshmerga means not having a unified country.”

Mr Serraj vows to confront IS, but is prioritising the reeling economy. Banks, short of cash, have limited withdrawals, or closed. So within days of arriving in Tripoli the prime minister froze state bank accounts for everything except salaries. Most Libyans now shun the banks and rely on the black market to trade currency. Militia commanders drive around in cars full of cash to pay fighters. High inflation and a weak dinar—Libya must import many staples—mean that even when cash is available, it doesn’t go far.

On its current trajectory, Libya would run out of money by 2019, says the International Monetary Fund. Output of oil, which accounts for almost all of government revenues, has fallen from 1.6m barrels per day at the start of 2011 to less than a quarter of that. There is hope that the GNA can increase the flow. It has received support from Ibrahim al-Jathran, leader of the semi-official Petroleum Facilities Guard (PFG), which had been aligned with the eastern government. Mr Jathran has promised to reopen installations that his forces blockaded because of disputes.

But the challenges posed by renewed oil sales suggest that the path ahead will be hard for the GNA. General Haftar could still make a play for the facilities in the east. In the west, militias from Zintan are blocking the main pipeline. IS continues to attack oilfields with little regard for who is guarding them. And the price of oil has crashed anyway. Still, for some the glass is half-full. “I’m not expecting 100%,” says Abdlrauf Beitelmal, the mayor of Tripoli. “Anything above 50% is good enough.”