Forces loyal to Libya's UN-recognised government said they fought off a "major" attack on the capital Tripoli led by Field Marshal Khalifa Haftar that left casualties on both sides.

On Monday, "our forces repelled a major attack by Haftar forces on several fronts in southern Tripoli which they had planned and mobilised for days," spokesman Mustafa Al Mejii told AFP.

He said six fighters loyal to the Tripoli-based Government of National Accord (GNA) were killed and several others wounded.

The fighting left 25 dead or wounded on the other side, he said.

GNA forces carried out seven air strikes on positions held by Field Marshal Haftar's self-styled Libyan National Amy in Tripoli suburbs, including Ain Zara some 12 kilometres (seven miles) from downtown Tripoli, the spokesman said.

"Within a few hours our forces succeeded in forcing them to retreat, and seized new positions that had been under the control of Haftar's forces," he said.

During the fighting GNA forces also destroyed military hardware, including three tanks, seized others and captured 11 fighters, the spokesman added.

The LNA meanwhile said in a statement on its Facebook page that it had made progress in the combat zone of southern Tripoli, "inflicting heavy casualties on the enemy", without giving details.

On the weekend, the GNA expressed fear that Field Marshal Haftar's forces were prepping a new "military escalation" in their months-long push to take Tripoli where the UN-recognised government is based.

Deadly fighting has rocked the capital's outskirts since the LNA launched an offensive to seize the capital.

The United Nations mission in Libya said in a tweet Saturday that it was working "with all local and foreign actors to avoid military escalation and to ensure protection of civilians".