Libyan Prime Minister Ali Zeidan was released on Thursday several hours after being seized from a Tripoli hotel by former rebel militiamen, the foreign minister said.
"He has been freed but we have no details so far on the circumstances of his release," Mohammed Abdelaziz said.
The pre-dawn seizure of Zeidan came five days after US commandos embarrassed and angered Libya's government by capturing senior Al-Qaeda suspect Abu Anas al-Libi off the streets of Tripoli and whisking him away to a warship.
"The head of the transitional government, Ali Zeidan, was taken to an unknown destination for unknown reasons by a group" of men believed to be former rebels, the government had said in a brief statement on its website.
A source in the premier's office said Zeidan had been taken from Tripoli's Corinthia Hotel, where he resides.
A group of former rebels, which had roundly denounced Libi's abduction and blamed Zeidan's government for it, said it had "arrested" Zeidan.
The Operations Cell of Libyan Revolutionaries, which in principle reports to the defence and interior ministries, had said on Facebook it had seized Zeidan "on the prosecutor's orders".
The premier "was arrested under the Libyan penal code... on the instructions of the public prosecutor", the group had said.
The cabinet had said on its Facebook page that ministers were "unaware of immunity being lifted or of any arrest warrant" for the prime minister.
The Operations Cell of Libyan Revolutionaries had expressed outrage at the brazen daylight raid by US commandos to capture Libi.