Tripoli international airport has come under rocket fire for a fourth straight day, as rival armed groups battled for control of the facility in the Libyan capital.

The airport was targeted on Wednesday by mortar fire and rockets for several hours, a security official said, sparking fire in and around it and damaging 20 aircraft, officials said.

"The damage [in the aircraft] ranges from serious to superficial, and we need time to see how grave the damage is," Abdulhakim Al-Fares, chairman of Afriqiyah Airlines, said in a televised news conference.

Tripoli International Airport became a battlefield at the weekend when a militia launched an attack to try to take control from a rival group, part of the turmoil in Libya three years after longtime ruler Muammar Gaddafi was toppled.

The fighting in the capital, the worst in months, has halted flights, stranding abroad many Libyans who were planning to return home for the Muslim fasting month of Ramadan and trapping expatriates.

The violence prompted the UN to pull its staff out of the North African country.

The Zintan fighters, in control of the airport for the past three years, have deployed armoured cars and pickups on access roads to head off any ground attack.

On Monday, the airport in the country's third city Misrata was also forced to shut down because it is linked to the control tower in Tripoli.

But flights resumed on Tuesday night at Misrata and also at Miitiga military airport in the suburbs of Tripoli.

The Libyan government has no control over former rebel fighters who helped topple Gaddafi in a NATO-backed uprising but now defy state authority and often battle for political or economic power.

Libyan government has recently said it is considering calling for international forces to help restore security.

Source: Agencies