At least 52 fighters of the UN-backed Government of National Accord (GNA) have been killed in heavy clashes with rival militiamen in the Libyan capital, Tripoli, according to a GNA official.

The fighting on Friday was concentrated in the Abu Salim, Salahedeen and Qasr Bin Ghashir districts, where plumes of black smoke could be seen rising above the city's skyline.

The clashes, which also wounded dozens of fighters, continued throughout Friday prayers, witnesses said.

Hachem Bishr, a national security adviser to the GNA, said that at least 17 of those killed were summarily executed by rival militias in Al-Akwakh district in Abu Salim.

Three governments

Following a UN-brokered deal in December 2015, the GNA arrived in Tripoli last year.

Led by Fayez al-Sarraj, it has struggled to exert its authority in the capital or beyond. It has also failed to rein in the militias that have held power on the ground since the 2011 uprising that toppled Libya's ex-ruler, Muammar Gaddafi.

The GNA issued a statement on Friday blaming the latest violence on Khalifa Ghwell, the head of a self-declared National Salvation Government (NSG), and Salah Badi, an allied militia leader.

Ghwell's NSG, which was set up in 2014, is also based in Tripoli but has extended its influence to Libya's west too. It is not recognised by the international community, but is backed by politicians from the now-dissolved General National Congress.

READ MORE: Libya foreign minister names Khalifa Haftar army chief

Besides the GNA and NSG, a third parallel - and rival - government is based in Tobruk, in eastern Libya.

The Tobruk-based House of Representatives does not recognise the leadership of Sarraj or Ghwell, and is backed by renegade General Khalifa Haftar.

Haftar, whose forces control key oil ports, is a dominant figure for factions in eastern Libya that have rejected the GNA, contributing to its failure to expand its power.

Calls for calm

The latest clashes follow a period of relative calm in Tripoli since March, when GNA-aligned groups pushed rival factions back from central neighbourhoods.

Al Jazeera's Mahmoud Abdelwahed, reporting from Tripoli on Friday, said fighting between pro- and anti-GNA groups had intensified, with rival factions mobilising their forces against their rivals.

"Hospitals told us the fighting is so heavy that they can't even get in the area to collect bodies."

An aid worker told the Reuters news agency: "We have received calls from families who want to get out, but unfortunately we can't reach them because of the clashes."

A Reuters reporter saw tanks, armoured vehicles and pickups mounted with anti-aircraft guns driving towards the battle from the north of the city.

Pictures posted on the internet also showed firefighters trying to extinguish a blaze in an office building in central Tripoli belonging to Mellitah Oil and Gas, a joint venture between Libya's National Oil Corporation and Italy's Eni.

Martin Kobler, UN's envoy for Libya, condemned the violence in a statement and called for an immediate restoration of calm.

"Voices of reason should prevail for the benefit of the country," he said. "Political aims must not be pursued through violence. Civilians must be protected."