Renegade Libyan general Khalifa Haftar is set to launch a military operation in Tripoli within days to purge the city from militant groups, according to a spokesperson for the general.

"Preparations for the Tripoli operations are almost finalised and it would be conducted in coordination between forces hailing from Zintan and military aircraft," Haftar's spokesman Mohamed Hegazi told Anadolu Agency.

According to Hegazi, the operation would be overseen by newly-appointed Army Chief-of-Staff Abdel-Razzaq Nazuri.

The army is yet to confirm Hegazi's assertion on the imminent operation.

Tripoli has been the scene of particularly fierce clashes between the Libya Shield, a coalition of militias, the bulk of which are from Misrata, and rival Al-Qaaqaa and Al-Sawaaq militias over control of the city's vital facilities.

The two militias have locked horns in and around the city since mid-July, almost totally destroying the airport and wreaking havoc in the capital. The fighting left dozens dead and hundreds injured.

Late last month, Libya Shield said it gained full control of the Tripoli airport after flushing out rival militiamen, mainly from Zintan.

In May, Haftar declared war on armed Islamist militias based in eastern Libya, dubbing his campaign "Operation Dignity" – the stated aim of which was to "purge" Libya of "extremists."

After serving as army chief-of-staff under Muammar Gaddafi, Haftar spent nearly two decades in the United States in exile before returning to Libya in 2011 to join the uprising against Gaddafi.

'Grave human rights violations'

Grave human rights violations have been committed during clashes in the Libyan cities of Tripoli and Benghazi, with disastrous consequences for civilians, a UN report said on Friday.

The warning came from the UN mission in Tripoli (UNSMIL) and UN rights office only days after Libya's outgoing government admitted from its safe refuge in the east that it has effectively lost control of the capital to armed militias.

The report accused the combatants of "indiscriminate shelling and attacks on civilian objects, the shelling of hospitals, the abduction of civilians, torture and unlawful killings", including of women and children.

"Dozens of civilians were reportedly abducted in Tripoli and Benghazi solely for their actual or suspected tribal, family or religious affiliation, and have remained missing since the time of their abduction," it said.

The United Nations agencies appealed to all parties to prioritise the protection of civilians.

"All armed groups must desist from violations of international human rights and humanitarian law, in particular, all acts that may amount to war crimes, including indiscriminate shelling, enforced disappearances, murder, abductions, torture and other ill-treatment, and destruction of property," it said.

Since the ouster of former dictator Muammar Gaddafi in 2011, Libya has been rocked by violence as the country struggled to maintained stability. This MEE video gives an overview of various militia movements since 2011.