Libya's National Oil Corporation warned on Sunday it could be forced to suspend production at its Zawiya refinery due to growing security threats to its staff and facilities.
"National Oil Corporation's board of directors has alerted the Petroleum Facilities Guard and competent authorities regarding the recent lack of protection and security at the Zawiya refinery," NOC said in a statement.
"Any continuation or failure to address this situation, to ensure staff and site protection and increase security, will affect ongoing operations and result in their suspension."
The refinery, located 45 kilometres (28 miles) west of Tripoli, receives around 125,000 barrels a day from the southern Sharara pipeline, representing less than half of Libya's oil output.
It also supplies Tripoli, where fuel shortages are already rife.
Libya descended into chaos after the 2011 uprising that toppled and killed longtime dictator Moamer Kadhafi, with rival militias and authorities vying for control of the country's oil assets.
In July, NOC halted crude exports from its Zawiya terminal after a drop in production following an attack.
"This situation is not sustainable, either from a worker security or production standpoint," NOC chief Mostafa Sanalla said in Sunday's statement.
"We expect the most basic principles of security to be upheld by those guarding NOC facilities, and call upon the relevant authorities to remedy this inadequacy immediately," he added.
Oil is Libya's main natural resource, with reserves estimated at 48 billion barrels, the largest in Africa. But oil facilities are the frequent target of armed groups and by the sector's own guards.