Clashes raged on Monday on the outskirts of Libya's capital Tripoli trapping residents indoors and hampering rescue efforts, as the UN called for talks after more than a week of deadly violence.Fighting since August 27 between rival militias in the southern suburbs has killed at least 47 people and wounded 129 others, most of them civilians, according to an updated toll put out by the health ministry on Sunday night.Following a failed ceasefire on Friday, the UN mission to Libya (UNSMIL) invited the "various Libyan parties" to Tuesday talks for an "urgent dialogue on the current security situation in Tripoli".UNSMIL did not give further information on the guest list, but analysts said the chaos of changing alliances on the ground made it difficult to predict who would be at the table."The situation is too fluid and the alliances are still volatile and changing," said Jalel Harchaoui, a Libya expert at the University of Paris 8.The Libyan capital has been at the centre of a battle for influence between armed groups since the ouster and killing of dictator Muammar Gaddafi in 2011.Libya's UN-backed Government of National Unity (GNA) on Sunday declared a state of emergency in Tripoli and its surroundings, as the violence cast doubt on general elections set for the end of the year.The clashes initially pitted GNA-linked groups in the capital against the so-called 7th Brigade, a militia from the town of Tarhuna southeast of Tripoli the GNA says it presented with orders in April to disband.In statements and videos, the 7th Brigade has claimed to be the true "army" and said it is carrying out an "operation to liberate Tripoli" from militias.'Championship of militias'Since the fighting broke out, other armed groups championing the same cause as the 7th Brigade have been drawn into the clashes against pro-GNA security forces.Those groups include militias from Misrata, about 200km from Tripoli.On Monday, armed groups had cut roads leading to their positions, "blocking access to aid and relief" and trapping families in the area, emergency services spokesperson Osama Ali said.Explosions could be heard from downtown Tripoli, and witnesses reported heavy fighting, particularly along the perimeter of the Wadi al-Rabii suburb in the southeast of the capital.In Tripoli's centre, life continued almost as normal, despite fears of looting, particularly after the escape on Sunday of some 400 common criminals from a prison at Ain Zara in the capital's southern suburbs.As clashes spiralled last week, the GNA called in an armed group from Zintan, 170km southwest of Tripoli, to help guard against a security vacuum in capital's west.On Sunday, it also called up the "anti-terrorist brigade" - mostly composed of armed militias from Misrata that helped push Islamic State group jihadists out of Sirte in 2016 - to intervene between the rival camps.But by calling other militias into Tripoli, some analysts believe the GNA is playing with fire."The entry of more armed groups into the capital can only exacerbate the situation," a Western diplomat told AFP on condition of anonymity.Social media users were quick to make light of the situation, calling the capital's chaos "Libya's championship of militias in Tripoli".A 'new balance'?The GNA has been accused by its detractors of submitting to militias, on which it and Tripoli depend for security, since it began working in March 2016."The four or five major militias in Tripoli have provided relative daily safety, appreciated by the population but also by foreign states interested in maintaining a diplomatic and commercial presence to seize on reconstruction opportunities," said Harchaoui.At the same time, they had "infiltrated the police and economic institutions", he added.The build up in Tripoli has left Zintan and Misrata, the two major militarised cities under the GNA's control, feeling "excluded from the new balance of power" in the capital, Harchaoui said, calling the situation "untenable".After Gaddafi's fall in 2011, the militias of Zintan and Misrata shared the capital, before they were respectively expelled in 2014 and 2016.One outcome of Tripoli's recent clashes could be the emergence of a "new balance of forces, that is a little more viable", Harchaoui added.But it was also possible that "violence is trivialised", he said, which would cast further dought on elections set for December.