Tunis: Three of 10 staffers kidnapped from Tunisia’s Tripoli consulate by Libyan militia last week have been released, and the remainder are expected to be freed soon, the foreign ministry said on Thursday.

Their release comes as Tunisian authorities announced that a Libyan man they have been holding, whose freedom was reportedly demanded by the kidnappers, is to be deported.

The 10 staffers were abducted on Friday when gunmen stormed the mission.

Libya descended into chaos after a revolt unseated longtime dictator Muammar Gaddafi in 2011. It now has rival governments and parliaments, as well as powerful militias battling for influence and a share of its oil wealth.

A foreign ministry source said negotiations for the liberation of all those held began the same day as the kidnapping.

“Three were freed on Wednesday, and talks are still under way for the release of the others.”

Foreign Minister Taieb Baccouche confirmed that, telling Mosaique FM radio that the outlook for the release of the remaining seven was “reassuring”.

Tunisian media and officials said the kidnappers had demanded the release of Walid Glib, a leader of theirs held in Tunisia for the past several weeks.

The prosecutor’s office said he had been detained on suspicion of “involvement in terrorist affairs”.

Spokesman Karim Shebbi said the “criminal division of the Tunisian Court of Appeal decided on Wednesday his provisional expulsion at the request of the Libyan authorities”.

However, he added that the authorities could request that he eventually be sent back to Tunisia to appear in court.

Tunisian citizens and interests are frequently targeted in generally lawless Libya, as are those of other countries.

On Friday, the foreign ministry advised Tunisians in Libya to leave if possible and to avoid travelling there unless absolutely necessary.

Last month, a militia seized 245 Tunisians in Tripoli. All were later released unharmed.

A Tunisian diplomat and an embassy employee were kidnapped last year before being released.

And in January, the Libyan branch of the Islamic State group claimed the killing of two Tunisian journalists who had gone missing in eastern Libya eight months earlier.