At least 13 people have been killed in fighting that flared overnight between armed groups in Tripoli, emergency services said Friday, the latest violence to hit the Libyan capital in months of rising political tensions.

Gunfire could still be heard early on Friday afternoon in eastern Tripoli after it first broke out after midnight in an area of parkland, sowing terror among Tripoli residents who head there to cool off after roasting summer days.

Dozens of people were forced to seek refuge on the campus of Tripoli University and a nearby medical centre.

The fighting "killed 13 people, among them three civilians including a child aged 11, and wounded 30," the ambulance service told news channel Libya al-Ahrar.

Members of the "444 Brigade" affiliated with Libya's Ministry of Defence man positions in the area of an overnight gunbattle in Tripoli's suburb of Ain Zara, on July 22, 2022
Members of the "444 Brigade" affiliated with Libya's Ministry of Defence man positions in the area of an overnight gunbattle in Tripoli's suburb of Ain Zara, on July 22, 2022 AFP / Mahmud Turkia

The clashes were between two armed groups with major clout in the west of the war-torn country: the Al-Radaa force and the Tripoli Revolutionaries Brigade.

Several sources said one group's detention of a fighter belonging to the other had sparked the fighting, which extended to several districts of the capital.

On Friday, another group called the 444 Brigade intervened to mediate a truce, deploying its own forces in a buffer zone before they too came under heavy fire, an AFP photographer reported.

But Prime Minister Abdulhamid Dbeibah's spokesman Mohamed Hamuda tweeted on Friday afternoon that Al-Radaa, which also acts as a police force, had "committed to halt combat operations" at the request of Dbeibah and the Presidential Council.

Tensions have been rising for months as two prime ministers vie for power in the North African country -- here a 444 Brigade member mans his position
Tensions have been rising for months as two prime ministers vie for power in the North African country -- here a 444 Brigade member mans his position AFP / Mahmud TURKIA

Government media said Dbeibah had suspended interior minister Khaled Mazen, appointing local government minister Badr Eddine al-Toumi in his place.

Tensions have been rising for months in Libya as two prime ministers vie for power, raising fears of renewed conflict two years after a landmark truce ended a ruinous attempt by eastern military chief Khalifa Haftar to seize Tripoli by force.

The dead were the first civilian casualties of fighting in Tripoli since the 2020 truce.

Members of the 444 Brigade take up positions after fighting between two militias nominally loyal to Abdulhamid Dbeibah's Government of National Unity
Members of the 444 Brigade take up positions after fighting between two militias nominally loyal to Abdulhamid Dbeibah's Government of National Unity AFP / Mahmud TURKIA

The fighting trapped hundreds of women attending weddings in the area, including Maisa bin Issa and her sisters.

"Thank God, the ambulance came and rescued us, otherwise we would have been stuck in the wedding hall in Ayn Zara, miles from our house in the city centre," she said.

"It was really scary with the bombing and gunfire."

Local resident Mokhtar al-Mahmoudi said he and his family had spent the night in the basement. "Our kids are still terrified," he said.

Malek al-Badri said he had used his phone to avoid major roads and find his way to his mother's house.

"Tripoli will never find peace again as long as all these armed groups are here," he said.

Dozens of students were trapped in university dormitories until they were rescued, Osama Ali of the ambulance service told Al-Ahrar.

Libya has been gripped by insecurity since a NATO-backed uprising toppled and killed dictator Moamer Kadhafi in 2011, leaving a power vacuum armed groups have been wrangling for years to fill.

Both groups involved in this week's fighting are nominally loyal to Abdulhamid Dbeibah's Government of National Unity, appointed last year as part of a United Nations-backed peace process to end more than a decade of violence in oil-rich Libya.

Dbeibah has refused to cede power to Fathi Bashagha, named in February as prime minister by a parliament based in Libya's east after he made a pact with Haftar.

The fighting forced the capital's only functioning airport, Mitiga, to close until further notice.

The United Nations Libya mission UNSMIL said it had received reports of civilian casualties and demanded an investigation.

"Any action that endangers the lives of civilians is unacceptable," it said in a tweet, calling on "all Libyans to do everything possible to preserve the country's fragile stability at this sensitive time".