Tunisia had submitted documents to the United Nations detailing the case against Moncef Kartas, a member of the UN panel of experts on Libya, who was detained on arrival in Tunis on March 26.
After reviewing the documents, the UN formally notified Tunisia's government that Kartas enjoys diplomatic immunity and "requested Mr Kartas' immediate release and for the charges against him to be dropped," UN spokesman Stephane Dujarric said.
The United Nations "remains very concerned by the continued detention and prosecution" of Kartas, a Tunisian-German dual national who has been a member of the panel since 2016.
The spokesman declined to provide details on the documents submitted by Tunisia, but made clear that the contents were unconvincing.
In mid-April, the world body had asked Tunisia to provide the reasons for his arrest, in line with its international legal obligations.
Kartas' lawyers have said that the charges were linked to the arms expert's possession of a device allowing him to have access to data on flights of civil and commercial aircraft.
The panel of experts investigates allegations of violations of the arms embargo and other sanctions imposed on Libya.
On April 4, Libyan commander Khalifa Haftar launched an operation to seize the capital Tripoli from the UN-recognized government.
The panel has reported that arms and ammunition deliveries continue to reach warring parties despite the UN embargo -- with the involvement of member states.