Militant gunmen attacked Libya's al-Ghani oilfield on Friday, killing 11 guards, beheading some of them, before local forces fought back to retake control, an oil security official said.
The al-Ghani attack illustrated Libya's growing instability where two rival governments battle for control while extremist militants profit from chaos to secure a foothold four years after civil war ousted Muammar Gaddafi.
Libya's internationally-recognised government of Prime Minister Abdullah al-Thinni has operated out of the east since a rival armed faction called Libya Dawn took over Tripoli in fighting last summer and set up its own administration.
With the rival governments both claiming legitimate control over oil operations, details about attacks, oil shipments and even production are difficult to verify.
The state-run National Oil Corporation in Tripoli said unidentified gunmen attacked al-Ghani from the north on Friday, causing "massive damage" without further details.
Oil security forces, allied with Thinni's eastern government, said on Friday they had retaken control of al-Ghani after the attack which killed at least 11 guards.
"Our forces have taken back control of al-Ghani oilfield from militants," security official Ali Hassi said. Several of those had been beheaded, he said, putting the total at 11 dead.
Hassi said they were also now in control of Mabrouk, Bahi and Dahra oilfields in the central Sirte basin, which were attacked by Islamist militants over the last week.
Libya's rival factions this week held United Nations-backed talks in Morocco in an effort to form a unified government and end a conflict Western officials fear will spiral into a full-blown civil war.
But air strikes on rival targets escalated three days before the talks in Morocco, and previous rounds of talks yielded little concrete progress.
"It is a difficult process. It would not give answers in hours or even days," U.N. envoy to Libya Bernardino Leon said after meetings in Morocco with the two factions.