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.
The health ministry of Libya's UN-backed Government of National Accord (GNA) said 10 people were killed and 15 wounded, three of them seriously, 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.
More From This Section
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.
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.
"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, AFP reporters said.
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.
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.