A brand new highway junction in a suburb of Tripoli was meant to showcase how the government was delivering improvements to the lives of ordinary Libyans but this week's deadly clashes left it ringed by burnt-out cars and littered with spent bullet cases.

The violence that killed 55 people around the intersection called "Return to Life" was Tripoli's worst in years and wrecked any illusion of an easing of Libya's decade of conflict and chaos that has often disrupted the OPEC state's oil output and made it a big departure point for migrants heading to Europe.

Prime Minister Abdulhamid al-Dbeibah and his interim Government of National Unity (GNU) has sought to consolidate power by splurging on social benefits and infrastructure, yet Libya remains splintered by armed factions vying for power.

"The gunfire was too loud and it was terrifying," said Ahmad Ibrahim, 35, a graphic designer who drives past the "Return to Life" junction on his way to work each day and heard the clashes that flared on Monday and raged in his Ain Zara district.

"It is very difficult to explain to your young son what is going on while you are trying to protect your family," he said, explaining how he had enjoyed the easier route to work and other benefits of government spending, such as more electricity.

Like other Libyans, Ibrahim is well aware of the power struggle that rumbles beneath any superficial improvements, but the scale of fighting was a shock. Factions exchanged artillery shells and heavy machine gun fire "like a nightmare", he said.

The fighting was triggered when one faction, the Special Deterrence Force, seized the commander of a rival unit, the 444 Brigade, as he tried to travel through Mitiga airport. The airport - which like other key state assets are coveted by armed factions - is controlled by the Special Deterrence Force.

UNEASY ALLIES

The Special Deterrence Force and most other armed factions hold semi-official positions and draw state salaries, acting as uniformed security forces even if they ultimately answer to their own commanders. But the judicial authorities have not announced any warrant against 444 Brigade commander Mahmoud Hamza to explain his detention.

Both factions backed Dbeibah during a violent power struggle last year. They are the most powerful in Tripoli along with a third, the Stability Support Apparatus. But they have never really been allies. Other groups were driven out of Tripoli.

Hamza, once an officer in the Special Deterrence Force, has turned the now rival 444 Brigade into one of Libya's strongest armed units, controlling swathes of Tripoli and strategically important areas south of the capital.

When Dbeibah held a parade for armed forces day last week, hundreds of 444 Brigade fighters took part. The interim prime minister described them in his speech as the Libyan army.

No political leader looks able to bring the armed factions under tighter state control or deliver a lasting solution to the wider conflict.

Nine years after the last national election, and after a string of interim governments and transition plans, Libya's political institutions regularly attack each other's legitimacy and are continually manoeuvring for temporary advantage.

International diplomacy has focused on pushing the eastern-based parliament and a Tripoli-based legislative body to agree on election rules, but they have made little headway.

Both those institutions have shown more focus on seeking to replace Dbeibah. Alongside some factions outside Tripoli, they regard Dbeibah as a rival for influence and power.

While Dbeibah has sought to consolidate his position with new roads, better power supplies or social benefits such as payouts to newly weds, faction leaders have complained about corruption in state spending. Dbeibah denies this.

As Dbeibah and some factions seek to increase their control in Tripoli, commander Khalifa Haftar remains entrenched in Libya's east. The status quo can deliver a semblance of calm. This week's clashes showed how quickly it can also evaporate.

(Reporting by Reuters Libya newsroom; Writing by Angus McDowall; Editing by Edmund Blair)