Islamic State militants clashed with security forces near Libya's Es Sider oil export terminal on Monday killing two guards, while an oil storage tank at nearby Ras Lanuf was set on fire during fighting there, witnesses and a guard said.
The guard told Reuters that Islamic State suicide car bombers had attacked Es Sider, after which the insurgents retreated, and that the tank at Ras Lanuf, about 20 km (13 miles) from Es Sider, had been hit by a rocket.
A spokesman for Libya's National Oil Company (NOC) said the tank was holding about 400,000 barrels of oil. The NOC was still trying to put out the fire late on Monday evening.
Libya descended into chaos after the fall of Muammar Gaddafi in 2011 and rival governments and the militias that support them are fighting for control of the North African state and its energy reserves. Es Sider and Ras Lanuf, its biggest oil ports lie between Sirte and Benghazi and have been shut for a year.
The group said it had attacked Es Sider after taking the nearby town of Ben Jawad. However, there was no independent confirmation of its capture.
Es Sider is protected by Ibrahim al-Jathran's Petrol Facilities Guard, which has backed the government based in the city of Bayda in the east, but is also fighting other forces supporting that government.
Libya's crude oil production has dropped to less than a quarter of a 2011 high of 1.6 million barrels per day.
The United Nations has been trying to win support for a deal brokered in Morocco last month to create a national unity government for Libya.
Separately on Monday, a plane targeting militant groups in the eastern city of Benghazi was shot down, though the pilot ejected, senior army commander Fadel al-Hassi told Reuters.
Forces allied to the Bayda government have been battling insurgents based in Benghazi for months.