At least three people were killed when a stray rocket hit their house as rival Libyan militias exchanged heavy fire around Tripoli's international airport, according to a security official.

A powerful militia from the western city of Zintan, which controls the airport, has been engaged in a week-long battle for the facility with Islamist-led militias, including fighters from Misrata, to the east of Tripoli.

The bombardment resumed early on Sunday after ceasefire efforts failed, the official said on condition of anonymity.

The fighting is said to have killed two militiamen from Misrata and a civilian who died when a stray rocket hit his house.

A mortar shell hit a Libyan Arab Airlines plane and a column of black smoke could be seen rising from inside the airport, which has been closed since Monday.

Tripoli is witnessing one of its worst periods of violence since Muammar Gaddafi was ousted in 2011. The rival militias, made up largely of former rebels, have forced a week-long closure of petrol stations and government offices.

Armed men have attacked vehicles carrying money from the central bank to local branches, forcing their closure.

In Benghazi, Libya's second-largest city, gunmen killed an army officer on Saturday while he was driving home in his car, and early on Sunday a former special forces officer was shot dead in the downtown Salmani district, according to a local security official. The UN support mission in Libya said last week that it was withdrawing its staff temporarily because of the deteriorating security situation.