At least seven Libyan soldiers were killed repelling an attack on their post by Islamist militants eight km (five miles) southwest of the eastern city of Benghazi on Monday, a military source told Reuters.
The troops belonged to the Libyan National Army (LNA), which supports the internationally recognised government, and were trying to prevent fighters loyal to Islamic State capturing tanks in the town of Annawaghia.
Benghazi is one front in Libya's complex conflict involving two rival governments, their allied armed factions, and Islamist militants who have gained a foothold in the chaos that prevails four years after the fall of Muammar Gaddafi.
"The forces of the Libyan National Army confronted the militants early this morning and forced them to withdraw," the source said.
The LNA is led by Khalifa Haftar, a general under Gaddafi who fights for the recognised government, which has been based in the east since a rival armed force took over Tripoli last year and set up its own government.
LNA forces have been battling for a year to control Benghazi against an alliance of an Islamist militants and former anti-Gaddafi rebels. Some foreign jihadist fighters loyal to Islamic State are also active in the city.
The United Nations is trying to broker a broad peace agreement in Libya, and has drafted a preliminary agreement for a national power-sharing administration. The recognised government has signed up to this but the unofficial Tripoli government has so far rejected it.
Western powers say the deal is the only solution to Libya's turmoil and are pressing for an accord as Islamic militant groups and migrant smugglers increasingly take advantage of the chaos.
Join Jerusalem Post Premium Plus now for just $5 and upgrade your experience with an ads-free website and exclusive content. Click here>>