Libya's newly elected national assembly has picked former opposition leader Mohammed Magarief as its president.

Mr Magarief, seen as a moderate Islamist, will head the 200-member congress, which will name a prime minister, pass laws and steer the North African country to full parliamentary elections after a new constitution is drafted next year.

Mr Magarief, leader of the National Front party, is effectively acting head of state. An economist and former Libyan ambassador to India who had been exiled since the 1980s,

Mr Magarief was a leader of Libya's oldest opposition movement – the National Front for the Salvation of Libya – which made several attempts to end Muammar Gaddafi's rule.

The 72-year-old's National Front Party is an offshoot of the old opposition movement and won three seats in the July 7 poll – Libya's first free vote in a generation.

"I am very, very happy. This is a big responsibility," he said after the late night vote on Thursday.

Mr Magarief won 113 votes versus independent Ali Zidan on 85 votes. Voting went to a second round after there was no outright majority in the first.

"This is democracy. This is what we have dreamt of," said Mr Zidan, congratulating Mr Magarief.

The assembly also voted for Giuma Attaiga, a lawyer from the port city of Misrata, as a deputy to Mr Magarief, who had been seen as a lead

"He is a political personality and everybody knows him," Othman Sassi, a former official of the National Transitional Council, said of Mr Magarief. "He has very good experience to lead congress and the Libyan democratic state."

Mr Magarief is from Libya's second biggest city, Benghazi, the cradle of last year's revolt. This is likely to placate fears that the region would be marginalised by a centralised authority in the capital Tripoli.

The national assembly took over on Wednesday from the National Transitional Council, the political arm of the opposition that toppled Gaddafi a year ago, which is now dissolved.