Mitiga airport, a former military air base on the eastern outskirts of the capital, was evacuated when the clashes erupted and roads to the facility were closed.
Six Libyan aircraft on the tarmac were hit by gunfire, an airport source said.
In an updated casualty toll, the health ministry of Libya’s UN-backed Government of National Accord (GNA) said 20 people were killed and 63 wounded in the clashes.
It did not specify if the casualties were civilians or fighters.
Several assailants were arrested, according to Tripoli security services run by the interior ministry.
"All the infrastructure of the military base and the airport are under control and undamaged," it said, although a resumption of flights had yet to be announced several hours later.
The airport source and a local resident said the assailants were repelled and that fighting moved to their headquarters around 10km to the east of the facility and had eased by late Monday.
Mitiga has been a civilian airport since the city’s main international airport was badly damaged in fighting between rival militias in mid-2014.
The North African country has been wracked by chaos since the 2011 uprising that toppled and killed long-time dictator Moamer Kadhafi, with rival authorities and militias battling for control of its oil riches.
The airport’s closure was announced after Al-Radaa, a force loyal to the GNA and tasked with keeping the facility secure, said it had come under attack.
An armed group "attacked Mitiga international airport... which is home to a prison where more than 2,500 people are detained for various" reasons, Al-Radaa said on its Facebook page.
Unidentified gunmen launched the attack in a bid "to free" some of their colleagues detained there, it said.
The GNA, in a statement, condemned "the premeditated attack on the perimeter of Mitiga International Airport... endangering the lives of passengers and the safety of civil aviation".
"This attack was aimed at the release of terrorists belonging to the Islamic State and Al-Qaeda organisations and other groups from the detention centre" run by Al-Radaa, it said.
Al-Ridaa said more than 2,500 people are detained at the centre for a variety of offences.
A Libyan pilot said earlier that the airport, the scene of frequent clashes between rival militias, was evacuated once the fighting broke out.
"All the staff and passengers who were at the airport were evacuated," the pilot said, speaking on condition of anonymity. "We saw tanks in the airport’s perimeter."
With all roads to Mitiga closed, artillery fire could be heard as far away as Tajura 30 kilometres (18 miles) east of Tripoli.
Only domestic airlines operate in the country, serving domestic routes and flights to Tunis, Egypt’s Alexandria, Amman, Istanbul and Khartoum. The EU has banned Libyan airlines for security reasons.
Since the 2011 revolution, Libya has descended into political and military chaos, with militias who had fought to topple Kadhafi often turning against each other.
Libya has rival administrations, with the authorities in the east not recognising the GNA based in the capital.
Al-Radaa is loyal to the GNA and also serves as a police force in Tripoli, as well as tracking suspected jihadists and drug and alcohol smugglers. Source: VNS