Benghazi: Islamic State group jihadists killed eight guards on Friday in an attack on the southern Libyan oilfield of Al-Ghani, a spokesman for the unit tasked with guarding oil installations said.
"Extremists from the Libyan subsidiary of IS mounted a surprise attack on the oilfield, killing eight soldiers," Ali al-Hassi said.
Libya's National Oil Company also confirmed the attack.
A statement from the NOC said that unidentified gunmen rampaged through buildings and other infrastructure and set fires, adding that staff were unharmed as they had fled.
Columns of smoke from the burning oilfield could be seen as far as the town of Zela, 60 kilometres (40 miles) away, the statement said.
Hassi said government forces later recaptured the oil installation, and that reinforcements were sent from nearby oilfields.
On Tuesday, Islamist militants seized Al-Bahi and Al-Mabrouk fields south of the city of Sirte, prompting the NOC to declare "force majeure" at all 11 oilfields in the North African nation.
The legal measure means that due to unforceable circumstances the NOC can be exonerated from fulfilling oil contracts.
The company also threatened on Wednesday to "close all fields and ports" if the security situation does not improve.
Violence and a slowdown at export terminals had already forced most oilfields to shut down for the past several weeks.
In February, 11 people were killed in an assault on Al-Mabrouk. No one claimed responsibility for that attack.
Oil is Libya's main natural resource, with a pre-revolution output of about 1.6 million barrels per day (bpd), accounting for more than 95 percent of exports and 75 percent of budget revenues.
But production fell to around 350,000 bpd in December when the Fajr Libya coalition of militias, including Islamist groups, attacked oil terminals in the east.
Libya has been awash with weapons since the 2011 uprising that toppled and killed Kadhafi, and opposing militias have since been battling to control its cities and oil wealth.
There are two rival governments and parliaments -- those recognised by the international community sitting in the far east and the others in the capital backed by Fajr Libya.