UPDATE 8-Libyan PM briefly held by gunmen angry at US Qaeda capture
* Former rebels blame Zeidan for capture of al Qaeda suspect
* Freed several hours after being snatched from hotel
* Libya's government struggles to contain rival militias
TRIPOLI, Oct 10 (Reuters) - Libya's prime minister was seized and held for several hours on Thursday by former rebel militiamen angry at the weekend capture by U.S. special forces of a Libyan al Qaeda suspect in Tripoli.
Ali Zeidan, a former diplomat opposed to Islamist radicals, was later seen arriving at his office by a Reuters reporter.
The prime minister was expected to give an account shortly of his six hours or so in captivity. Gunmen associated with the fragmented Libyan security apparatus had hauled him at dawn from the luxury hotel where he lives under heavy guard.
Zeidan had distanced his government from U.S. assertions it cooperated in Saturday's capture of Abu Anas al-Liby, wanted for the al Qaeda bombing of the U.S. embassy in Kenya in 1998. But the group which seized Zeidan appeared to hold him responsible for helping Washington's operation.
His brief detention was the latest of many incidents that underline how, two years after a Western-backed uprising ended 42 years of rule by Muammar Gaddafi, Libya is in turmoil. Its vulnerable central government and nascent armed forces are struggling to contain tribal militias and Islamist militants who control parts of the country.
The militia, which was hired by the government to provide security in Tripoli, said it "arrested" Zeidan after U.S. Secretary of State John Kerry said Libya had a role in the capture Liby, whose real name is Nazih al-Ragye.
"His arrest comes after ... (Kerry) said the Libyan government was aware of the operation," a spokesman for the group, known as the Operations Room of Libya's Revolutionaries, told Reuters. Adding to confusion, Libyan television later carried a denial from the Operations Room that it was involved.
The government said Zeidan had been "kidnapped".
Geoff Porter of North Africa Risk consulting said: "His kidnapping clearly indicates that his government is not cohesive, and that not only is his government not in control of the country, but that he is not in control of his government."
Before his release, an official in the Interior Ministry anti-crime department told the state news agency that Zeidan, a former diplomat and exile opposition activist against Gaddafi, was being held there and was being treated well.
The prime minister, who is in his early 60s and has held the post for the past year, was taken from the Corinthia Hotel, where many diplomats and top government officials live. It is regarded as one of the most secure places in Tripoli.
A tweet attributed to Zeidan after his release was reported by government officials was disowned by other officials.
The kidnapping, however brief, raised the stakes in the unruly OPEC nation, where the regional factions are also seeking control over its oil wealth, which provides Libya with the vast bulk of government revenues.
After the Arab Spring revolts that ousted several autocratic leaders, Libya's transition has been one of the messiest.
It still has no new constitution, Zeidan faces a possible vote of no confidence and its transitional assembly, the General National Congress, is paralysed by divisions between the secular National Forces Alliance and the Muslim Brotherhood.
Zeidan, viewed as a liberal opposed to radical Islamists, has struggled to fulfil a promise to clean up rival militias made up of former rebels which often battle on the streets of Tripoli and the eastern oil hub of Benghazi, occupying government buildings and imposing their will through force.
Libya's defence minister resigned in June after militias besieged two ministries. Another group of armed protesters has taken over oil ports in the east for the last two months, slashing the country's crude output by half.
A mix of striking workers, militias and political activists have blocked Libya's oilfields and ports for more than two months, according to Oil Minister Abdelbari Arusi, resulting in over $5 billion of lost revenues.
He said on Oct. 2 that oil exports could return to full capacity in days once the strikes ended.
Repsol and Eni, involved in western Libya, have seen output largely restored since fields reopened last month. But companies invested in eastern Libya are entering a third month of closures at several important export terminals.
Oil companies have become more wary of North Africa after an attack in January on the Amenas gas plant in neighbouring Algeria, a top gas supplier to Europe and an oil-producing OPEC member.
Liby is being held on a U.S. warship in the Mediterranean.
After Zeidan was seized, the U.S. State Department said it was "in close touch with senior U.S. and Libyan officials on the ground."
The Operations Room of Libya's Revolutionaries had been affiliated with the Interior Ministry which assigned them to provide security in the capital as part of a programme to reintegrate former fighters.
Guards at the hotel said there were no shots fired or clashes during the incident.
Al-Arabiya television channel quoted Libya's justice minister as saying that Zeidan had been "kidnapped" and showed what it said were video stills of Zeidan frowning and wearing a grey shirt undone at the collar surrounded by several men in civilian clothes pressing closely around him.
Zeidan said on Tuesday Libyans accused of crimes should be tried at home, but that the raid to capture Liby would not harm U.S. ties - trying preserve relations with a major ally without provoking a backlash from Islamist militants.
But the raid angered militant groups, including one blamed for the assault on the U.S. consulate in Benghazi in 2012, who called for revenge attacks on strategic targets including gas export pipelines, planes and ships, as well as for the kidnappings of Americans in the capital.