Independent MP Nouri Bousahmein, a member of Libya's Berber minority, was elected on Tuesday as head of the General National Congress (GNC), making him the country's interim leader.
Bousahmein, the first Berber to hold such a senior post in Libya, replaces Mohammed Megaryef, who stepped down after a law was adopted banning from politics those who served under ousted dictator Moamer Kadhafi.
Bousahmein was chosen by the assembly on a second ballot, after leading a nine-candidate first round.
He received 96 out of 184 votes, against 80 for another independent, Al-Sherif al-Wafi.
Under the rules of the GNC, Libya's highest legislative and executive body, a simple majority was required for the election of its president.
The country's two leading parties, the Muslim Brotherhood-backed Party of Justice and Construction and the liberal Alliance of National Forces, did not put forward candidates.
At the beginning of Tuesday's session, the PJC called for the vote to be postponed until a commission has been formed to apply the new law, but was overruled by GNC Vice President Jomaa Atiga.
Following the vote, Atiga adjourned the session until later in the day.
Bousahmein is a law graduate of the University of Benghazi and worked at the Abu Kamash chemical complex from 1978 to 2000.
He was elected to the GNC from his home town of Zuwara and became a rapporteur of the assembly.
The Berbers make up about 10 percent of Libya's population. They were persecuted under Kadhafi and continue to feel marginalised under the new regime.
They live primarily in the mountains west of the capital or, like the Tuaregs, in the southern desert.
Megaryef was Libya's ambassador to India in the 1980s under Kadhafi before he defected to become a leader of the exiled opposition for three decades.
He was elected to head the GNC last August following Libya's first post-uprising polls in July.
He stepped down at the end of May to comply with the law, passed at the beginning of that month, despite it not having yet come into force.
A number of MPs have proposed exempting him from the law, which bans officials who served under Kadhafi between September 1, 1969 and the fall of his regime in October 2011.
Around 20 members of the Congress and administration officials are also expected to quit their jobs in compliance with the law.