Four US military personnel that had been detained by the Libyan government have been set free, a US official told AFP late Friday.