Four US military personnel detained by the Libyan government have been released, US officials have confirmed.

A US Defense Department official said the four American service members have been freed, according to Reuters. They were reportedly being held by Libya’s Ministry of the Interior in the town of Sabratha. "All four (have been) released," the official said.

The reason for their detainment and their current whereabouts were not immediately known.

The US State Department previously confirmed the detainment.

"We can confirm that four US military personnel are currently being held in Libyan government custody," said Jen Psaki, State Department spokesperson. "We are seeking to further ascertain the facts and ensure their release. We are in touch with Libyan officials on this issue."

A senior US Defense Department official told CNN that the four were being held by the Interior Ministry. The service members were reportedly in Libya "augmenting security at the US Embassy in Tripoli," the official added. The four are believed to have been reviewing potential evacuation routes for diplomats at the time of detainment, according to The New York Times.

Photos of two American passports and embassy ID cards were posted on Twitter, supposedly related to the detentions, the Times reported.

The original detainment occurred in a town southwest of the Roman ruins, at Sabratha, according to the Times. The town is approximately a one-hour drive from Tripoli.

The detentions followed an announcement by the United States in November that it would increase support for Libya’s security forces, which have been overwhelmed by violence and unrest since the death of Muammar Gaddafi.