REUTERS - When Islamic State militants attacked a perimeter gate guarding Libya's Es Sider oil terminal this month, they sent gunmen to kill guards before attempting to detonate a car bomb in a bid to breach the port's defenses.
The assault failed to get closer than a mile (1.6 km) from one of Libya's major oil ports, but it signaled Islamic State's intent to expand beyond their base in the city of Sirte and target the OPEC state's oil infrastructure.
Four years after the fall of leader Muammar Gaddafi, Libya is in a conflict with two rival governments each backed by competing armed factions, creating a power vacuum that has allowed Islamic State to establish a foothold in North Africa.
It was not the first Islamic State attack on Libyan oil. But the country's petroleum industry is already battered by conflict and protests, producing less than half the output of 1.6 million barrels per day (bpd) it had in 2011.
In its Middle East heartland, where it controls large swathes of land in Iraq and Syria, Islamic State has accessed revenue from oilfields. Terrorism experts estimate its income at $2.9 billion a year, much of it from oil and gas.
In Libya, though, Islamic State is still consolidating. It co-opts domestic Islamist ranks, but faces rival armed factions with strong local ties. That resistance and the structure of Libya's energy industry and export system may also prevent Islamic State from controlling assets and revenue.
But as chaos deepens, so do its opportunities.
With Sirte as a base, earlier this year Islamic State fighters attacked several nearby oilfields, capturing and killing several foreign contractors and disrupting oil production in the area.
Libya's oil sector is still in turmoil. Production is at around 500,000 bpd, several oilfields are closed due to fighting among rivals or protests, and two key export terminals, Es Sider and Ras Lanuf, have been shut since December.
"No doubt, we have an obstacle which is Islamic State, especially in the middle region of Libya," the oil minister for Tripoli's government, Mashallah Zwei, told Reuters. "But Islamic State in Libya is different to Iraq and Syria."
The attack on Es Sider's perimeter earlier this month looked a typical hit-and-run strike of a group facing a stronger opponent rather than an orchestrated takeover. Gunmen in several vehicles opened fire with Kalashnikov rifles and heavy machine guns at a gate around 700 meters west of the port.
One guard, belonging to a federalist force allied with the recognized government, was killed and two others wounded. Militants tried to detonate a car-bomb at the gate, but four of them were shot dead, security officials said.
Es Sider and Ras Lanuf, with a total export capacity of 500,000 bpd, have been closed since December because of fighting between federalist forces controlling the ports and brigades allied with Tripoli's self-styled government who vowed to take them back.
"Islamic State has realized that the largest factions are more interested in fighting each other," said Mattia Toaldo, Libya specialist at the European Council on Foreign Relations. "It is expanding in central Libya, encountering little resistance."
Since the NATO-backed revolt toppled Gaddafi, Libya has fractured into a complex jigsaw of rival brigades of ex-rebels, tribal factions and Islamist-leaning forces who have steadily turned against one another in an internecine battle for control.
Tripoli has been held since last year by Libya Dawn, an alliance of armed factions from the port city of Misrata and Islamist-leaning fighters who drove rivals out of the capital and set up their own self-declared government.
Libya's internationally recognized government and elected parliament now operate out of Tobruk in the east, backed by a loose coalition of armed forces, including ex-Gaddafi ally General Khalifa Haftar and the federalists controlling the ports.
Powerful armed factions hold different areas and cities and their loyalties are often more aligned with local interests, complicating U.N. attempts to negotiate a unity government.
Libya's oilfields and ports also sit in areas held by competing factions, allowing one armed group to cut off a pipeline, for example, to pressure another.
In March, Islamic State made its first major move on oil, storming and damaging several Libyan oilfields around al-Ghani. That forced the government to declare force majeure, and shut down production at 11 oilfields in the central Sirte basin. Eleven guards were killed, several by beheading.
But there was no attempt to hold fields and secure revenue as Islamic State has done in Iraq and Syria. The aim was destruction.
"The profile of the sector is just too different from that of Iraq," said Geoff Porter at West Point's Combating Terrorism Center. "If Islamic State can get even temporary chokeholds on the sector then it can weaken its opponents and buy itself time to consolidate its position."
Even before Islamic State's arrival, Libya's oil industry has been in almost constant flux since Gaddafi's fall, held or taken over by one of the country's competing armed forces rather than any central government.
Low oil production is cutting into energy revenues that pay for most of the national budget. The situation has been further complicated by the rivalries between the two governments, who both appointed state oil officials and energy ministers.
Relations between competing forces controlling oil ports and the Al-Ryayna pipeline leading from the key El Sharara oilfield to ports illustrate the complexities of bringing output back.
Tripoli says it is negotiating with tribal elders to lift a blockade on the pipeline carrying crude through an area controlled by forces from the town of Zintan, who oppose the Tripoli authorities.
But Zintan forces deny any talks with Tripoli's government, saying the fields were closed as a precaution by oil guards after recent Islamist attacks on southern fields.
"There are no consultations with the ministry of oil and gas in Tripoli as it is not legitimate," the mayor of Zintan, Mustafa Al-Barouni, said.
Tripoli state news agency LANA said another oilfield, El Feel, may be reopened within days after a deal to pay guards' salaries. But one commander said they still had not been officially told to restart and must wait for the Al-Ryayna pipeline to open.
Early last year, federalist forces commanded by Ibrahim al-Jathran ended months of blockades of the four major oil ports, including Es Sider, that his forces control, after threatening to bypass the government and sell oil himself.
His forces since battled the Tripoli faction this year when they tried to retake Es Sider. But he also recently split with forces backing the recognized government.
U.N. efforts to broker a unity government among the main factions have stalled, and a failure to bring all on board only leaves Islamic State more chance to target oil again.
"Their goal is to maximize the impact of their operations on oil production while minimizing losses," Riccardo Fabiani, North Africa analyst at Eurasia Group, said. "They are likely to continue to do so."
Want to enjoy 'Zen' reading - with no ads and just the article? Subscribe todaySubscribe now