SOON after mass protests against Colonel Muammar Qaddafi took off, he sought to make sure he would either keep control of the country's oil or prevent the rebels from having it. Once they had taken swathes of territory that included many of Libya's oilfields, he set about sabotaging them—and hit the pipelines taking the oil to refineries and ports from which they could be sold. The colonel has also tried to prevent the rebels' fledgling administration from selling the oil on its own account.

He has had mixed success. As the rebels advanced along the coastal road between Brega and Ras Lanuf, sites of two big refineries, the towns' export infrastructure was knocked out and the country's gas network was cut in half. In April loyalist troops drove hundreds of kilometres across the desert to attack oil installations above the huge Sarir and Mislah oilfields, about 500km (311 miles) south of Benghazi, and destroyed a booster station half way up the line that pumped oil to the port of Marsa el-Hariga, next to Tobruk.

That blocked off about 300,000 barrels of oil a day (b/d) the rebels hoped would give them a vital and steady source of income. To mend the station, they need spare parts from outside Libya, but foreign outfits are wary of coming back. Until those facilities are repaired, the rebels cannot export any oil from the area they control. Their only sale was on April 6th when a Swiss-based trading house, Vitol, loaded 1m barrels at Marsa el-Hariga. The deal earned them about $120m, paid into an account in Qatar, where the state petroleum company has agreed to market the east's oil.

In the areas still run by Colonel Qaddafi, which accounted for about three-quarters of Libya's total pre-war output of 1.6m b/d, the oil infrastructure has suffered less damage but has been hit by the departure of foreigners. In its latest estimate, the International Energy Agency puts production at 200,000 b/d—but all output has probably ceased. A rebel says the regime has 3.6m barrels of oil left, sitting in storage tanks in Ras Lanuf, Sirte and Mellitah.

Use the interactive “Graphics Carousel” to browse our coverage of unrest in the Middle East

The colonel's oil men have been searching for traders willing to buy 600,000 barrels of this stored oil; a Lebanon-based trader may be ready to do a deal. But European Union sanctions ban transactions with various Libyans and companies, including the National Oil Company. So far the General National Maritime Transport Company (GNMTC), the state-run shipping firm run by one of the colonel's sons, Hannibal, has not faced sanctions, though Britain is keen to include it in the ban. American sanctions bar all transactions with Libya, though the American Office of Foreign Assets Control is planning to exempt those conducted by the rebels' Transitional National Council. Still, dodgy traders are working on elaborate ways to buy Libya's highly prized light, sweet, paraffin-rich crude, including tanker-to-tanker loading in international waters and passing money through offshore companies into accounts belonging ultimately to the GNMTC or other regime loyalists.

Both sides badly need fuel to run their war machines. On this score, the rebels are in better shape. Qatar Petroleum and small refineries in Tobruk and Benghazi are meeting local demand of about 18,000 b/d. In March the rebels also seized a Greek-flagged ship carrying fuel bound for the western side and unloaded its cargo. Vitol, in co-operation with Qatar Petroleum, has shipped at least 11 cargoes of fuel to the rebels, landing it at Tobruk.

In the area Colonel Qaddafi controls, the Zawiya refinery near Tripoli may still process some oil, though much less than the plant's capacity of 120,000 b/d. Lorries laden with diesel and gasoline have been passing through the coastal border with Tunisia, though rebel sympathisers in Tunisia may now be stopping them. The west needs twice as much fuel as the east. Shortages are increasing fast. Cars in Tripoli, the capital, sometimes queue for days to fill their tanks. Petrol there fetches up to seven Libyan dinars ($5.85) a litre, against 13 cents a litre in Benghazi.