ISLAMIC STATE (IS) in Libya is a popular target these days. From the east and south, the army of Khalifa Haftar, Libya’s most potent warlord, is moving on the coastal city of Sirte, which is controlled by some 5,000 jihadists. To the west, the UN-backed administration of Fayez al-Serraj has created an anti-IS command centre in Tripoli, the capital. And a rival government in the west is also preparing for the fight, as are tribes around Sirte. It is a shame, then, that these groups are failing to work together. The main divide, as ever, is between the east, where General Haftar backs yet another government, and the west, where Mr Serraj is struggling to establish his authority. Each side sees the fight against IS as an opportunity to bolster its standing—at the other’s expense. They are both scrambling for Sirte and may soon take aim at each other, as well as the jihadists. The UN warns of civil war again.

America and Europe want Libya’s armed groups to unite under Mr Serraj, who was installed as prime minister after politicians from both sides of the country signed an agreement in December. But that deal has still not been approved by the parliament in the east, where some oppose handing control of the army to the new administration without guaranteeing the future of General Haftar.

Mr Serraj has hunkered down at a naval base since arriving in Tripoli on March 30th. After a smooth start, in which he was handed control of state institutions and backed by several militias, he has struggled to make progress. Citizens still suffer from power cuts, cash shortages and a lack of security. Worse, IS is on the move. On May 5th the jihadists took Abu Grain, 130km west of Sirte, without much of a fight from the forces aligned with Mr Serraj.

Needing to reassert some authority, Mr Serraj announced his new-command centre the following day. He has filled it with army officers from Misrata, home to dozens of linked militia groups that form the main rivals to General Haftar’s forces. Their focus is meant to be on the west of the country, to avoid an inter-regional conflict. But Misratan forces have already skirmished with General Haftar’s troops near Zillah, south of Sirte.

It is, for now, “a rhetorical race to Sirte”, says Jason Pack of Libya-Analysis, a consultancy. No one has actually attacked the jihadists. General Haftar, who is backed by Egypt and the UAE, is still consolidating his supply lines. But he seems eager to prove himself an indispensable ally in the West’s fight against IS—and to increase his influence in future negotiations over the shape of Libya’s government. Some believe he is hoping for Mr Serraj to fail, and then to assume the role of strongman.

On his way to Sirte General Haftar may try to snatch up oil facilities along the coast, which are protected by the semi-official Petroleum Facilities Guard. The black stuff is yet another cause of dispute between east and west. The national oil firm, which has pledged its allegiance to Mr Serraj, is the only body allowed to export oil, says the UN. But the eastern government has set up a parallel institution and tried: on April 25th a tanker carrying its first shipment was turned back from Malta.

The eastern government has since blocked all oil shipments from the port of Marsa el-Hariga. If its allies gain control of facilities in Brega, nearly all Libya’s already diminished oil exports could be cut off. That would deny Mr Serraj a critical source of revenue, and legitimacy—he, of course, has to pay salaries and run the state. Libya’s foreign reserves, used to keep it afloat, are running perilously low.

General Haftar is raising tensions in other ways. He has refused to meet Martin Kobler, the UN’s envoy to Libya. And he has struck an alliance with commanders who served under Muammar Qaddafi, Libya’s late dictator. IS, for its part, is likely to put up a vicious defence of its stronghold. America, Britain and France, which have troops on the ground in Libya, may eventually be forced to choose between backing Mr Haftar in his fight against IS in Sirte, or preserving the legitimacy of Mr Serraj.