TUNIS - The attacks against Libya's biggest oil terminals were lethal and sustained. The last two weeks have seen suicide bombings, huge fires at storage tanks, and a hole blown in a major pipeline.
The oil ports of Es Sider and Ras Lanuf had been closed for more than a year, and the Islamic State militants advancing on them backed off after three days of shelling and clashes.
But the escalation of violence in Libya's coastal "oil crescent" has underscored the threat to an energy industry that, despite the political chaos plaguing the country, still provides vital income to the state.
Oil is central to Libya's livelihood and the power struggles following the 2011 overthrow of Muammar Gaddafi often focused on the industry. The OPEC member's exports plunged from 2013 as armed groups began shutting down production to press political demands.
Last year, as two rival governments competed for power from Tripoli and the east, Islamic State gained a foothold in the city of Sirte and launched its first attacks against oil infrastructure.
The group has not taken control of oil fields, as it has in Syria. But it has pushed along the coast from Sirte, consolidating its presence in towns including Ben Jawad, just 30 km (19 miles) west of Es Sider.