Tripoli: Islamists killed at least 19 soldiers Thursday after a surprise attack in which they used speedboats in a failed bid to seize some of Libya`s main oil terminals, officials said.

The fighting in the oil-rich region came as pro-government forces lost ground to Islamist militias in the eastern city of Benghazi, where jihadists beheaded six people and killed 14 others, military officials said.

The militiamen belonging to the Fajr Libya, or Libya Dawn, launched the attack on Al-Sidra port by firing rockets from speedboats, setting an oil tank on fire, security sources said.

Soldiers damaged three of the vessels before clashes in which at least 19 of them were killed, they said, adding the militants were eventually repelled.

"These speedboats had fired several rockets at the terminals of Ras Lanuf and Al-Sidra and one of them hit a tank south of Al-Sidra port which then caught fire," said Ali al-Hassi, security spokesman for the region.

Witnesses said the attack was launched overnight, and reported seeing smoke from the burning oil tank.

A military source said 19 soldiers were killed, and that the oil tank struck by a rocket was still burning in Al-Sidra.

Fourteen of the soldiers belonged to the 136th battalion responsible for monitoring a power plant west of Sirte, the source said.

Al-Sidra is located in "oil crescent" region that has been the scene of recent fighting between government forces and Fajr Libya.Since the clashes erupted on December 13, the country`s oil production has dropped to nearly 350,000 barrels per day compared with 800,000 previously, according to industry experts.

A medical source at Ibn Sina hospital in Sirte said the facility received 18 bodies from the fighting.

"The armed forces on Thursday repelled an attack in which the Fajr Libya militia tried to seize the Al-Sidra oil terminal," said Hassi, who put the final toll at 19 soldiers dead.

The number of casualties among the Islamists was unknown.

The 136th battalion is affiliated with the military, and most its fighters are from a tribe loyal to former general Khalifa Haftar.

A military official said Haftar`s forces and pro-government troops had lost several positions in Benghazi to Islamist militias in the past 24 hours.

"Islamist gunmen seized large parts of Al-Lithi in south-central Benghazi, setting fire to 45 homes of people linked to Haftar and pro-government forces," the official said.

The official, who declined to be named, said six people were beheaded and 14 others killed in the attacks.

Haftar`s forces have been fighting alongside forces from the internationally recognised government of Prime Minister Abdullah al-Thani to overrun Islamists from Benghazi.

Islamists in the summer seized control of Tripoli after fierce fighting with nationalist forces.

On December 16, a warplane belonging to Fajr Libya fired missiles at a sector to the west of Al-Sidra, in the first such raid in the energy-rich region.

More than three years after dictator Moamer Kadhafi was toppled and killed in a NATO-backed revolt, Libya is still awash with weapons and powerful militias, and has rival parliaments as well as governments.