warplanes bombed militia positions in the Libyan capital Tripoli in what could mark a sharp escalation of fighting between armed factions that has thrown the North African state into anarchy.

Several Libyan television channels said unidentified planes targeted bases of militiamen from Misrata, who have been battling brigades from the western Zintan region to gain control of Tripoli in the country's worst violence since Muammar Gaddafi was toppled in 2011.

Residents in the capital reported jets flying over the city after midnight followed by explosions, and Libyan media said the aircraft had targeted militias from Misrata that have been battling with a rival group for control of the city.

Libyan forces loyal to renegade General Khalifa Haftar later said they were responsible for the air strikes.

"We, the operation dignity, officially confirm to have conducted air strikes on some militias' locations belonging to Misrata militias," said Haftar's air defence commander, Saqer al-Jouroushi. He was referring to Haftar's campaign against Islamists.

A Zintani source said fighters of his unit saw planes bombing a Misrata emplacement. "Our forces at the airport saw massive and accurate bombings [on a Misrata position]," he said.

Pro-Misrata news websites had earlier accused General Haftar of ordering the air strike. Haftar has previously used some aircraft from an air base under his control in Benghazi to attack militant Islamists in eastern Libya.

The struggle in the capital is part of worsening chaos in the country where rebels who helped to topple Gaddafi in 2011 now vie for power and a share of Libya's oil wealth.

On Sunday gunfire and shelling could be heard near the airport and other parts of Tripoli, but the fighting was less fierce than on Saturday, when much of the city was a battlefield.

The battles have forced the United Nations and Western governments to evacuate their diplomats, fearing Libya is sliding into civil war.