The International Criminal Court (ICC) has promised to investigate allegations of wrongdoing by its staff in Libya.
In a statement, the ICC said the probe would take place "following the return of the four staff members".
The four went to Zintan earlier this month to meet Saif al-Islam Gaddafi, the son of the late Libyan leader.
One of them, Australian lawyer Melinda Taylor, was accused of trying to pass him documents from a former ally and was then detained.
"The ICC deeply regrets any events that may have given rise to concerns on the part of the Libyan authorities," the statement said.
"In carrying out its functions, the Court has no intention of doing anything that would undermine the national security of Libya," it added.
If found responsible for any misconduct, the ICC would ensure that staff "will be subject to appropriate sanctions," it went on.
The ICC statement came after a high-level Libyan delegation visited the Court at its headquarters in The Hague on Friday to explain the detentions.
The delegation, headed by Libya's Attorney-General Abdelaziz Al-Hassadi, had provided the ICC with "information regarding the visit of the four staff members to Zintan", but it did not specify what the information was.
Australian lawyer Melinda Taylor was detained after accusations she clandestinely passed Mr Gaddafi a coded letter from a fugitive former aide, Mohammed Ismail.
Her Lebanese translator Helene Assaf is accused of being her accomplice.
Two others - Russian Alexander Khodakov and Spaniard Esteban Peralta Losilla - are with them, but it is unclear whether they are staying out of solidarity for their colleagues or are also being detained.
The ICC, the Australian government and rights groups had previously all demanded the immediate release of the four. The ICC had said their detention is illegal as they are immune from prosecution.
But Tripoli says the accused have put national security in jeopardy and will be held while they are investigated.
The Zintan militia captured Saif al-Islam last November and have since refused to hand him over to central authorities in Tripoli.
Libyan authorities have been involved in a tussle with the ICC over where Saif al-Islam should stand trial over his role in last year's uprising that ended his father's decades-long rule of Libya.
The ICC had been permitted to provide him with access to ICC-appointed defence lawyers, and those detained were part of that team.