Benghazi: Clashes continued for the second day among heavily-armed militias in the Libyan capital Tripoli, vying for power and control over the city, with one dislodging another in at least two posts, a five-star hotel and a barracks, in what appears to be the worst outbreak of violence the city has seen in two years.

Competing militias have chopped Tripoli up into fiefdoms and power centres after longtime dictator Muammar Gaddafi, Libya’s ruler for 42 years, was ousted and killed in an uprising in 2011. They maintain what observers describe as a “balance of terror.”

Witnesses in Tripoli said Friday that gun battles rocked the southeastern Nasr Forest district and adjacent neighbourhoods as residents were advised by a local emergency body affiliated with the Interior Ministry to remain home and away from windows. The clashes started Thursday and have reportedly killed at least eight, according to state news agency LANA. During a lull in the violence late Thursday night, panicked residents could be seen lining up outside gas stations to stock up on fuel.

In a statement Friday, UN Envoy to Libya Martin Kobler called for halt to the fighting, saying he is “extremely alarmed.”

“It’s completely unacceptable for armed groups to fight to assert their interest and control, particularly in residential areas, terrorising the population,” he said.

Reached by phone, a female resident in Tripoli told The Associated Press that families had locked themselves in their homes.

“We haven’t slept all night and we haven’t left the house since yesterday. All we are hearing is screaming, bombings and gunfire,” she said, “The security situation is going from bad to worse.”

“We just want the militias to leave,” she pleaded.

The UN-brokered unity government has not commented on the ongoing fighting and, given the fluidity of the situation, it remains to be seen whether the victors of the clashes will back the internationally-recognised body.

“This is a struggle over power. Each of the warring parties has its political and ideological agendas,” said Sami Al Atrash, a Tripoli resident and a legal expert. “The clashes were expected at any moment and finally happened.”

In March of this year, the prime minister of the unity government, Fayez Sarraj, arrived quietly by boat in Tripoli from Tunisia. Militias in control of the capital showed no resistance.

One of Tripoli’s warring sides is supportive of Sarraj and comprised of mainly local militias, such as the ultraconservative Salafist forces led by Abdel-Raouf Kara, known as the Special Deterrent Force, or “Rada” in Arabic. One of Tripoli’s largest and most powerful militias, Tripoli Revolutionaries, led by Haytham Al Tajouri, had previously been ambivalent about the unity government, but it has now joined forces with the Rada militia.

The other warring group is more sceptical of the unity government. Some hail from the western city of Misrata, while others are linked to the former leader of the one-time Jihadist but now defunct Libya Islamic Fighting Group by Abdul Hakim Belhaj. They are backed by the hard-line Grand Mufti Sadek Al Ghariani. Both of Belhaj and the Grand Mufti are believed to be receiving financing from Qatar.

The two sides have been exchanging accusations of orchestrating killings and kidnappings. The latest dispute involved an aide to Al Ghariyani, Nader Al Omrani, whose body was found weeks after he was abducted, and the Rada militia was blamed for his killing.

On Thursday night, the Rada and Tripoli Revolutionaries militias took control of the five-star hotel Al Mahary Radisson Blu Hotel in central Tripoli, where Belhaj had turned some of its rooms into offices. The same alliance also took over the 6th Division barracks once occupied by rival militias.

Fighting also broke out in the vicinity of the Rixos hotel, to the capital’s southeast — its convention centre was once the meeting venue for the outgoing parliament but has since changed hands.

Pictures posted by activists on social media showed militiamen firing RPGs from rooftops, and armoured vehicles and pickup trucks mounted with anti-aircraft weaponry occupying main streets.

The fighting is believed to be the worst in two years, following Libya’s last parliamentary elections when Islamists were dealt an unexpected blow, and the anti-Islamist head of the armed forces general Khalifa Haftar launched an offensive against Islamist militants in the eastern city of Benghazi.

Friday’s fighting came amid unconfirmed reports that the UN would make substantial amendments to the current political agreement to give Haftar a share of power, which could anger his rivals in Tripoli and Misrata.

As the fighting in Tripoli rages on, Sarraj’s government may be pleased to see one of its rivals — the militias linked to Belhaj and the Grand Mufti — crushed, but given a climate of regularly shifting alliances, it’s still unclear whether the battles will serves the interest of the UN-backed unity government.

Meeting with his Italian counterpart in Rome, US Secretary of State John Kerry blamed the violence on Haftar and others refusing to join the unity government, saying that the ongoing violence was “only empowering extremists.”

“Our tool is diplomacy,” Kerry hastened to add, explaining that no military action by the US or Western countries was being considered to stabilise Libya.