(Adds details from officials, background)

BENGHAZI, Libya, Jan 5 (Reuters) - Islamic State militants resumed shelling near the Libyan oil port of Es Sider on Tuesday and an oil storage tank in the port was hit by a long-range rocket causing a fire, a petroleum guards spokesman said.

Guards spokesman Ali Hassi said the militants were 30-40 km (19-25 miles) from the port, which they also targeted on Monday in an attack that left seven guards dead and 25 wounded.

The National Oil Corporation (NOC) said the oil tank fire had started just as firefighters were close to bringing under control another fire at an oil tank in the nearby port of Ras Lanuf, which was hit during fighting on Monday.

Es Sider and Ras Lanuf, Libya's biggest oil ports, have been closed since December 2014. They are located between the city of Sirte, which is controlled by Islamic State, and the eastern city of Benghazi.

Libya slipped into turmoil after the fall of Muammar Gaddafi in 2011 and rival factions and militias have been competing for the country's oil wealth.

The country's crude oil production has dropped to less than a quarter of a 2011 high of 1.6 million barrels per day.

Islamic State militants have taken advantage of a security vacuum to tighten their grip on Sirte, and have been threatening to advance east along the coast. However, they have not yet taken control of oil installations, as they have in Syria.

On Monday, suicide car bombers from the militant group struck near Es Sider and there were clashes between its fighters and petroleum guards. The tank that was hit on Monday in Ras Lanuf, 20 km (13 miles) from Es Sider, was holding about 400,000 barrels of oil.

(Reporting by Ayman al-Warfalli; writing by Aidan Lewis; editing by Jason Neely and Louise Heavens) ((Aidan.Lewis@thomsonreuters.com;))