Libya's Congress elected a human rights lawyer as interim prime minister on Sunday, a week after his predecessor was sacked for failing to present an acceptable Cabinet line-up.
Former independent congressman Ali Zidan claimed 93 votes, securing a majority in a poll to determine the country's leader for a transitional period of around 20 months.
His immediate priority will be to name a new government that the Congress can agree on.
The Cabinet will be faced with the daunting task of disarming thousands of men who fought in last year's eight-month civil war.
Ministers will also be pressed to provide basic services and restore security by creating a military and police force capable of asserting authority over disparate militias left over from the war.
Militias are currently deployed on the outskirts of the mountain town of Bani Walid, one of the few remaining strongholds of Muammar Gadaffi-era loyalists.
Any prime minister who wants to impose his authority on the militias will need broad national support for his government - but such support is hard to come by.
The 200-member congress selected Mr Zidan following last week's dismissal of Mustafa Abushagur after just 25 days in the post for failing to present a Cabinet list that satisfied legislators in the country's congress.
Mr Zidan was a diplomat under then-president Gadaffi before defecting in the 1980s and joining Libya's oldest opposition movement, the National Front for the Salvation of Libya, in Geneva.