At least 264 people have been killed in weeks of fighting on the outskirts of Libya's capital.

TRIPOLI (AFP) - At least 264 people have been killed and over 1,200 wounded in weeks of fighting on the outskirts of Libya s capital, the World Health Organization said Tuesday, as African leaders called for an immediate ceasefire.

The WHO used Twitter to urge "a temporary cessation of hostilities, and for all parties to respect humanitarian law".

Eastern-based strongman Khalifa Haftar launched an offensive on the capital on April 4, as his self-styled Libyan National Army pledged "to purge the west of terrorists and mercenaries".

Forces loyal to the internationally recognised Government of National Accord (GNA), based in Tripoli, launched a counter-attack at the weekend.

The fighting has since eased somewhat as both sides appeared to be preparing for the next phase of the battle, but intermittent explosions and gunfire have continued including a huge blast near Tripoli.

Fighting in Tripoli s southern suburbs has so far displaced at least 35,000 people, UN humanitarian coordinator for Libya Maria do Valle Ribeiro said Monday.

"Displacement is continuing at an increasing rate every day," she said, warning that the figures were a conservative estimate.

The two sides have reached a near stalemate since armed groups backing the GNA launched their counter-attack on Saturday.

An AFP team on the ground at the weekend confirmed that GNA-aligned fighters had pushed the frontline back several kilometres in the southern district of Ain Zara, around a dozen kilometres south of the city centre.

Another frontline is a little further southwest, around the districts of al-Swani and Qasr ben-Ghachir, around 30 kilometres from Tripoli, on a key road between the capital and the old international airport.

The International Organization for Migration s Libya office voiced concern Tuesday over "unacceptable and extremely worrying developments" at a detention centre for migrants in Qasr ben-Ghachir.

"Defenceless migrants were reportedly subject to random shooting and several of them were seriously injured" it said on Twitter.

GNA forces spokesman Mustafa al-Mejii said Tuesday most fronts were "calm" and that pro-GNA troops had been ordered to consolidate positions around the airport.

Later in the afternoon, they faced heavy fire as they tried to maintain a forward position on a security checkpoint less than 20 kilometres from Gharyan, on a key road south of Tripoli.

In a statement, they said they had seized strategic positions "cutting the road between Gharyan and Haftar s forces in the outer districts of Tripoli".

Early in the evening, the city was rocked by an enormous blast which the GNA said was caused by an LNA airstrike targeting pro-unity government forces on Tripoli s western outskirts.

"There were no casualties or material damage," the GNA said.

Haftar s force said on its official Facebook page it had received "significant" reinforcements, particularly in the west.

Valle Ribeiro said civilians were being displaced every day, while some had been trapped by fire including "heavy artillery and... shelling in some densely populated parts of the city".

"Any country who has leverage should be using that leverage to ensure that civilians can be protected," she said.

African leaders called Tuesday in a joint statement for an "immediate and unconditional halt" to fighting in Libya following a summit in Cairo led by Egyptian President Abdel Fattah al-Sisi, current chair of the African Union.

The AU s Libya "troika", which includes Sisi and his Rwandan and South African counterparts, urged "all parties to act with restraint" and to facilitate "the delivery of humanitarian aid".

Egypt and the UAE, which strongly oppose Islamist militants and the Muslim Brotherhood, back Haftar.

The military commander also spoke by telephone to President Donald Trump last week, in an implicit sign of US support that undercut international calls for restraint on all sides.

And while the UN recognises the GNA and its leader Fayez al-Sarraj, Haftar s diplomatic star appears to be rising.

The White House said Trump "recognised Field Marshal Haftar s significant role in fighting terrorism and securing Libya s oil resources".

That came a day after Russia and the United States opposed a British bid at the UN Security Council, backed by France and Germany, to demand a ceasefire in Libya.