Four US military personnel who were being held by the Libyan government have been released.

The details of the incident and the reasons for the detentions on Saturday are as yet unknown.

Photographs of two American passports and embassy identificaiton cards were circulated on Twitter, purportedly in relation to the detentions.

"We can confirm that four US military personnel are currently being held in Libyan government custody," said Jen Psaki, State Department spokesperson, before the release.

"We are seeking to further ascertain the facts and ensure their release. We are in touch with Libyan officials on this issue."