TUNIS, Tunisia (AP) — Ten Tunisian diplomats seized by Libyan gunmen linked to the Tripoli government have been released and flew home, Tunisia's foreign minister said Friday, while denying that they had been traded for a militia leader.

The Libya Dawn militia stormed the Tunisian consulate in Tripoli on June 12 and seized the diplomats, demanding the release of Walid Klib, who was detained in Tunisia last month on terrorism charges.

Klib was extradited to Libya in the early hours of the morning, according to his lawyer, Wissem Saidi.

Baccouche also announced that Tunisia was closing its consulate in Tripoli because of the Libyan authorities' inability to ensure diplomats' security.

The militia that attacked the consulate is a key supporter of the Tripoli government, whose minister of justice is Klib's uncle.

Jamal Zubia, spokesman for Libya's Tripoli-based government, explicitly linked the release of Klib to that of the hostages when he said on his Facebook page Wednesday that, "The page of the Tunisian consulate will be turned and they will return to their families when, God willing, the revolutionary hero Walid Klib returns to his family."

Libya has been divided between rival governments in Tripoli and Tobruk, and hundreds of militias, in the aftermath of its 2011 civil war that ousted dictator Moammar Gadhafi.

The Tunisian press criticized the government for what they are calling a trade between Klib and the diplomats, describing it as the latest slight to Tunisia's dignity and giving in to Libyan pressure tactics.

The Tunisian government, however, has denied there was any kind of trade, maintaining that Klib's extradition was legal under a 1961 convention between the two countries.

"The Foreign Ministry had no link to this affair which relates to justice (ministry)," Foreign Minister Taieb Baccouche told Tunisian radio, without elaborating.

The Foreign Ministry has warned Tunisians not to travel to Libya under the current instability unless absolutely essential. Despite the dangers, an estimated 60,000 Tunisians work there.

____

Associated Press reporter Maggie Michael contributed to this report from Cairo.