Libyan Prime Minister Ali Zeidan has been freed after being abducted and held for several hours by former rebels.
Officials did not immediately give details about his release, which comes after he was grabbed before dawn on Thursday from the Tripoli hotel where he lives.
A statement on the government's website said assailants took the head of the transitional government to a unknown destination.
A group of former rebels known as the Operations Room of Libya's Revolutionaries claimed responsibility, announcing that they had "arrested" the prime minister. The group blamed Zeidan's government for playing a role in Saturday's raid by U.S. special forces that captured senior al-Qaida operative Abu Anas al-Libi.
The Libyan government tried to distance itself from the raid, but militants and other Libyans have been furious that American forces carried out the operation on sovereign territory.
U.S. Secretary of State John Kerry defended the capture, calling it "legal and appropriate." He said the Libyan government's complaints are unfounded, and that Libi will go before a court of law.
U.S. State Department spokeswoman Jen Psaki, who is traveling with Kerry, said Thursday the U.S. is looking into the prime minister's abduction and is in close touch with Libyan officials.
British Foreign Secretary William Hague condemned the abduction and called for the prime minister's immediate release. He also stressed the need for Libya to maintain its political transition process.
Zeidan, who holds executive powers, has struggled to reunite and rebuild a nation fragmented after the toppling of long-time leader Moammar Gadhafi in 2011. Local militias and jihadist groups hold sway over much of the country.
Militants have also attacked foreign missions, most recently the Russian embassy, but also the French embassy earlier this year and the U.S. consulate in Benghazi in 2012. U.S. ambassador Christopher Stevens was killed during that attack.