Ten Tunisian diplomatic staff who were kidnapped in Libya a week ago have been freed and returned home.
Foreign Minister Taieb Bakouch said the consulate had now been closed and urged all Tunisians to leave the country.
He denied reports that the workers were freed in exchange for a Libyan militia commander.
Walid Kalib, who leads a brigade in the “Libya Dawn” alliance which controls Tripoli, was recently arrested in Tunisia on terrorism charges.
Libya Dawn spokesman Jamal Zubia on Wednesday wrote on his Facebook page:
“The page of the Tunisian consulate will be turned and they will return to their families and the revolutionary hero Walid Kalib returns to his family,” reports AP news agency.
In urging Tunisians to leave Libya, Mr Bakouch said “we cannot again be subject to any blackmail,” according to the Reuters news agency.
However, he said that the decision to deport Mr Kalib had been taken by the courts, independently of his ministry.