Rebels have killed at least 19 soldiers after a surprise attack in which they used speedboats in a failed bid to seize some of Libya's main oil terminals, officials have said.

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

Soldiers damaged three of the vessels before clashes, they said, adding the rebels were eventually repelled.

The number of casualties among the rebels was unknown.

"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.

Al-Sidra is located in the region known as the "oil crescent" that has been the scene of recent fighting between government forces and Fajr Libya.

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, adding that it was during this attack that the 19th soldier died.

Haftar forces

Fourteen of the soldiers belonged to the 136th battalion that is affiliated with the military and mosts of its fighters are from a tribe loyal to former general Khalifa Haftar.

Haftar's forces have been fighting alongside forces from the internationally recognised government of Prime Minister Abdullah al-Thinni against the rebels who have seized control of cities including Tripoli.

A military official said Haftar's forces and pro-government troops had lost several positions in Benghazi to the rebels 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," said the official, who declined to be named.

He said six peole were beheaded and 14 other killed in the attacks.

Source: AFP