A Libyan security official says the country's deputy intelligence chief has been released, a day after he was abducted by gunmen as he was leaving the airport in the capital, Tripoli.

The abduction came against a backdrop of days of deadly clashes in the city.

It was unclear who had abducted the intelligence deputy, Mustafa Nouh, whose family is originally from Misrata, a former rebel stronghold.

The security official said Nouh was released on Monday but gave no further details. The official spoke on condition of anonymity in line with regulations.

Public anger had been directed at Misrata militias who developed a strong presence in Tripoli following the fall of longtime dictator Moammar Gadhafi in 2011.

Weekend clashes by rival militias and violence had killed nearly 50 people in Tripoli.