Deadly clashes raged on Sunday around Libya's main international airport, closing it down, as the anti-Islamist militia that control it came under attack, airport officials said.
The exchanges of fire with heavy weapons killed at least six people and wounded 25, a health ministry official said.
It was not immediately known if civilians were among the casualties.
The assault on the Zintan militia which controls the airport by Islamist militants came after the UN pulled staff from Libya citing security reasons, and as Washington warned of further escalation.
An airport official said “rockets struck inside the airport perimeter around 6am (04h00 GMT)”, followed by heavy clashes between the rival gunmen.
Loud explosions and heavy gunfire were heard in the city centre, 25km away, AFP correspondents reported.
An airport source said Zintan fighters pushed back the assailants but that clashes continued to rage around the facility, as locals reported seeing tanks deploy and smoke billowing.
The clashes later scaled down to intermittent exchanges of automatic weapons fire, an AFP correspondent said.
The authorities said the airport would stay closed for at least three days.
Government spokesman Ahmed Lamine, meanwhile, urged an “immediate and unconditional” ceasefire, calling on both sides “to halt all hostile actions”.
The closure prevented Libya's foreign minister, Mohamed Abdelaziz, from travelling to a two-day meeting near Tunis of his counterparts in North Africa to consider how to aid chaos-riddled Libya.
A foreign ministry source said Libya would be represented by its ambassador to Tunisia, Mohamed al-Maalul, at the closed-door meetings in Hammamet, a town south of Tunisia's capital.
The former rebel Zintan militia helped topple strongman Muammar Gaddafi in a 2011 Nato-backed uprising, and is now well established in Tripoli, controlling the airport and military sites.
The heavily armed group, named after a hill town south-west of the capital, is considered the armed wing of the liberal movement jockeying for power with Islamists who dominate parliament.
Sunday's attack was claimed by the Operations Cell of Libyan Revolutionaries, a coalition of Islamist militias seen as the armed wing of Islamists within the General National Congress (GNC) or parliament.
“The revolutionary forces arrive within the perimeter of Tripoli airport and clash with armed groups inside,” it said on its Facebook page.
Britain's Minister for the Middle East Hugh Robertson in a statement urged an immediate end to the fighting and called on all parties to engage in “meaningful dialogue”.
European Union presidency holder Italy, meanwhile, called for United Nations-led diplomacy in Libya to aid the democratic transition.
“There has not been adequate support for transitions after regimes are toppled and we are still paying the price,” Foreign Minister Federica Mogherini told the ANSA news agency.
The fighting comes weeks after a contested June 25 general election to replace the Islamist-dominated GNC, which has been mired in controversy and accused of hogging power.
Libya, awash with weapons since the uprising three years ago, has also been plagued by growing lawlessness, while on the political front rival cabinets are jostling for power.
The embattled Tripoli government has struggled to establish a strong army and police force, allowing ex-rebels a free hand to act.
Sunday's clashes came just hours after the United States warned that the conflict could become “widespread” unless a new parliament is seated quickly and a new constitution drafted.
“The United States is deeply concerned by the ongoing violence in Libya and dangerous posturing that could lead to widespread conflict there,” State Department spokeswoman Jen Psaki said.
On July 6, Libya's electoral commission scrapped the election results from 24 polling stations, citing fraud, and said final results would be announced on July 20.
Commentators say liberals will fill most seats in the new parliament, unlike in the former assembly.
The mounting violence prompted the United Nations Support Mission in Libya to announce on Thursday that it was pulling out dozens of staff.
The well-armed and disciplined Zintan militia, officially under the jurisdiction of the defence ministry, has sided with rogue general Khalifa Haftar, who has launched a deadly offensive in eastern Libya aimed at crushing Islamist militias. - Sapa-AFP