Libyan Prime Minister Ali Zeidan returned unharmed to government headquarters in Tripoli Thursday, soon after he was released by former rebel militiamen who had abducted and held him for several hours.
Gunmen seized Mr. Zeidan early Thursday at a Tripoli hotel where he lives and held him for six hours.
A government statement said he was taken by armed men to an "unknown place for unknown reasons."
In televised remarks following his release, Mr. Zeidan told his Cabinet he hoped his abduction will not cause tensions in Libya. He thanked some militia who helped free him.
It is unclear who carried out the kidnapping. A militia group known as the Operations Room of Libya's Revolutionaries claimed responsibility but later denied involvement.
The group had blamed Mr. Zeidan's government for playing a role in Saturday's U.S. Special Forces raid in Libya that nabbed senior al-Qaida operative Abu Anas al-Libi, who is being held aboard a U.S. Navy ship.
U.N. Secretary-General Ban Ki-moon condemned the abduction of the Libyan prime minister. Mr. Ban said it was a "wake up call" for Libya and every other country experiencing political transformation.
Libya has struggled with instability and violence since the ouster of longtime dictator Moammar Gadhafi in late 2011.
Rebel groups that fought against Mr. Gadhafi have given rise to militias and militant groups that control parts of the country.
Attacks have targeted foreign diplomatic missions in Libya, including the Russian embassy last week, the French embassy in April and a U.S. consulate last year.
Libya asked the United States to explain the operation against Abu Anas al-Libi, calling it a kidnapping. Mr. Zeidan said Tuesday his country wants to keep good relations with the United States, but that Libyan citizens should face prosecution at home.
U.S. Secretary of State John Kerry defended the capture of the al-Qaida operative, calling it "legal and appropriate." He said the Libyan government's complaints were unfounded, and that the suspect will go before a court of law.