Fighting erupted in Tripoli on Wednesday when gunmen tried to free comrades seized by ex-rebels, and an army officer was assassinated in Benghazi, highlighting Libya's continuing insecurity nearly two years after dictator Moamer Kadhafi fell.
The clashes broke out in the Abu Slim area near the centre of the capital, a security official said, and gunfire from heavy weapons could be heard in several areas of the city.
Plumes of smoke could be seen rising into the sky above Abu Slim, an AFP journalist at the scene said.
"It's a war here," Meftah, a resident of the area, told AFP.
Rebels from Zintan first entered Tripoli in August 2011, when they helped to drive forces loyal to Kadhafi out of the capital during the uprising against his rule.
Since then, some of these groups have stayed in the capital, occupying former military bases and other state institutions.
On Tuesday, a group of gunmen from Zintan attacked the headquarters of the petrol installations guard, for reasons that are still unclear, before other ex-rebels intervened with force to stop them.
Members of the country's highest political authority, the General National Congress, said in a statement on Wednesday that clashes the night before in the Tripoli suburb of Salaheddin had killed five people.
Meanwhile, in the restive eastern city of Benghazi, an army officer died after a bomb placed in his official vehicle exploded, medical and security sources said.
The bombing took place a day after unknown gunmen killed six soldiers at a checkpoint south of Sirte, Kadhafi's hometown.
Lieutenant Colonel Jemaa al-Misrati was "gravely wounded and died of his injuries in the operating room," an official at Benghazi's Al-Jala hospital said.
Witnesses said the bomb exploded shortly after Misrati left home, with a security official saying the vehicle had been "booby trapped".
Eastern Libya, where the 2011 uprising began, has seen attacks against the authorities and Western interests, which have been blamed on Islamists.
Among them was an assault on the US consulate in Benghazi on September 11 last year in which ambassador Chris Stevens and three other Americans were killed.
On Tuesday, a top African Union counter-terrorism official warned that post-Kadhafi Libya had become a major transit hub for terrorists on the sidelines of a regional security conference in neighbouring Algeria.
"I have many reports which say Libya has become a major transit hub for the main terrorist groups travelling from one country to another," said Francisco Caetano Jose Madeira, the AU's special representative in charge of counter-terrorism.
The GNC also elected independent MP Nouri Bousahmein, a member of Libya's Berber minority, as its head, making him the country's interim leader.
Libya's new authorities are battling to establish military and security institutions capable of restoring law and order and state authority in the face of armed militias who fought Kadhafi's forces.
Since the fall of Kadhafi's regime, militia groups, mostly ex-rebels, have managed border controls, prisons, strategic facilities in the country and vital institutions.
They received salaries and other perks from the authorities, and benefitted from smuggling and extortion.