Libya's newly empowered top legislative body has elected as its president late a veteran opponent of Moamer Kadhafi's ousted regime who is seen as pro-Islamist.
Mohamed al-Megaryef, a founding member of the Libyan National Salvation Front, which grouped exiled opponents of the now slain dictator, defeated liberal independent Ali Zidane in a run-off by 113 votes to 85 in the 200-member General National Congress.
The vote in the assembly, elected in landmark polls on July 7, came after the National Transitional Council handed over power on Wednesday, in a symbolic move marking the first peaceful transition in Libya's modern history after four decades of Kadhafi's iron-fisted rule.
The assembly is tasked with choosing an interim government that will steer the country until fresh elections can be held under a new constitution to be drafted by a panel of 60 members.
Its new president is an economist with a doctorate from Britain, who held leading posts in the Kadhafi regime in the 1970s before defecting in 1980 to join the opposition in exile.
Hounded by Kadhafi's intelligence service, Megaryef survived assassination attempts in Rome in 1981, in Casablanca in 1984 and in Madrid in 1985, his daughter Asma said.
The Kadhafi regime also took reprisals against family members who stayed in Libya, jailing several of his brothers.
Regarded as a moderate Islamist close to the Muslim Brotherhood, Megaryef was elected to the assembly on the ticket of his former exiled grouping, now renamed the National Front Party.
A member of the Brotherhood's Justice and Construction Party (JCP), who asked not to be identifed, said Megaryef's election was "a victory for the Islamists."
But an independent assembly member said several members voted for him on geographical and not religious or political grounds.
Megaryef was born in 1940 in Libya's second city Benghazi, which was the cradle of last year's uprising but many of whose residents have complained their role has not been sufficiently rewarded in the post-Kadhafi Libya.
At the session, which was broadcast live on state television and ran on into the early hours of Friday, the assembly also elected the first of two vice presidents.
Jommaa Atiga, an independent from Libya's third-largest city Misrata, which resisted a devastating siege by Kadhafi's forces during last year's uprising, defeated JCP candidate Salah al-Makhzum.
The assembly adjourned its session at 3:30 am (0130 GMT) without electing a second vice president.
Under the interim constituion, decisions in the assembly require a two-thirds majority to pass, making cooperation necessary to avoid gridlock in the delicate transition.
The majority of the assembly's 200 seats were set aside for independent candidates, many of whose loyalties and ideologies remain unclear but who are being wooed by various blocs.
Political parties were allowed to contest just 80 of the seats.
The liberal National Forces Alliance of Mahmud Jibril, who served as premier during last year's conflict, won 39 on its own. It can also counts on the support of a centrist party led by Ali Tarhuni, who held several key posts during last year's revolt, and which won two seats.
The Brotherhood's JCP took 17 seats but its leader, Mohammed Sawan, has said it can match the support of Jibril's party in the assembly with the backing of independents.