Nine Libyan soldiers were killed in the eastern city of Benghazi on Tuesday by a suicide bomber and in ensuing clashes between troops and Islamist fighters, medics and military sources said.
Forces loyal to Libya's internationally recognised government have been fighting Islamist groups in the country's second-largest city since last year, part of a wider struggle since Muammar Gaddafi was overthrown and killed in 2011.
A suicide bomber rammed a car laden with explosives into a group of soldiers during a street battle in the city centre near Benghazi's Mediterranean port, killing three soldiers and wounding eleven, medics said.
Shortly afterwards, Islamist fighters blamed by the army for the suicide bombing attacked troops loyal to the official government in the same area. Six more soldiers were killed and 10 wounded in the fighting, medics said.
Clashes between Islamist fighters and government forces continued after nightfall in central Benghazi.
Army forces backed by armed residents have regained some areas in Benghazi lost to the Islamist brigades last year. But critics say their war planes and heavy guns have turned parts of the city into rubble without gaining much on the ground.
The Benghazi fighting highlights the chaos in Libya, where two rival governments are vying for control. The official prime minister has been based in the east since the capital Tripoli was seized by a rival group that set up its own government.
Both sides command loose coalitions of former anti-Gaddafi rebels who, after the strongman's ouster in 2011, split into factions along political, regional and tribal lines.
Islamic State has exploited the chaos by launching suicide bombings, executing foreigners and staging attacks against embassies in Tripoli.