BENGHAZI, Libya (Reuters) - Three days of Islamic State attacks on Libya’s biggest oil terminals have started fires that have spread to five massive oil storage tanks, a guards spokesman said on Wednesday.

Ali al-Hassi said the Petroleum Facilities Guards were still in control of the neighbouring ports of Es Sider and Ras Lanuf, where at least nine guards were killed and more than 40 injured near the ports’ perimeters on Monday and Tuesday.

Hassi said guards had recovered bodies of 30 Islamic State fighters, and had captured two military tanks and other vehicles from the militants.

He also said the guards had received air support from forces loyal to the General National Congress (GNC), the government that has controlled Tripoli since its rival, which was internationally recognised, moved to Bayda in the east in 2014.

Firefighters were trying to control four fires at Es Sider and one at Ras Lanuf. Two were triggered by Islamic State shelling, and three more had caught fire, Hassi said.

Mohamed al-Manfi, an oil official in eastern Libya, said each of the oil tanks was estimated to contain 420,000 to 460,000 barrels of oil.

Es Sider and Ras Lanuf lie between the city of Sirte - about 200 km (125 miles) along the coast and controlled by Islamic State - and the eastern city of Benghazi. They have been closed for more than a year.

Libya is split between political factions and armed groups competing for power and for the country’s oil wealth, four years after the revolt that toppled Muammar Gaddafi. Oil output has dwindled to less than one quarter of a 2011 high of 1.6 million barrels per day.

Islamic State has used the security vacuum to expand its presence, though it has not taken control of oil installations in the country.

The militants attacked guards at Es Sider in October, but this week’s offensive was a more concerted assault on the ports.

Mustafa Sanalla, chairman of the National Oil Corporation (NOC) in Tripoli, said he hoped the violence would “lead political leaders on all sides in Libya to understand the magnitude of the threat we face”.

“We need to unite against this common enemy, not tomorrow or next week, but now,” he said in a statement.

The NOC also issued a separate statement saying it would do all it could to honour contracts and protect Libya’s oil resources.

The U.N. is trying to win support for a deal to form a national unity government in Libya, but the plan has faced resistance from members of the rival parliaments.