"I've chosen Major General Khalifa Belgacem Haftar for the post of commander-in-chief of the army after promoting him to the rank of lieutenant general," Aguila Salah, the speaker of the internationally recognised parliament, told AFP.
Libya has been awash with weapons since the 2011 uprising that toppled dictator Moamer Kadhafi, and opposing militias have since been battling for control of its cities and oil wealth.
It has two rival governments and parliaments -- those recognised by the international community sitting in the far east of the country and the others with ties to Islamists in the capital, Tripoli.
A new round of UN-sponsored dialogue aimed at resolving the nation's political crisis is set to be held Thursday in Morocco, after the parliament decided to resume stalled talks.
Haftar's appointment had raised fears that it would derail the efforts of the UN envoy to Libya, Bernardino Leon, to restart the political dialogue.
On Monday night, however, the internationally recognised parliament voted to return to the UN-brokered talks a week after suspending its participation, a lawmaker told AFP.
- Controversial general -
The internationally backed legislature created the post of army chief under a new law passed last week.
A member of parliament said at the time that the law was adopted to "legitimise" Haftar, who calls himself chief of the Libyan National Army.
Army spokesman Colonel Ahmed al-Mesmari said Haftar would be sworn in on Tuesday before the assembly.
Last May, Haftar launched an offensive against Islamists in the country's east, focused on the second city of Benghazi, prompting the then-government to accuse him of trying to stage a coup.
But after Islamist militias seized Tripoli, following disputed elections in June, the internationally recognised authorities have gradually allied themselves with a figure previously seen as a power-hungry rogue general.
Signup to our newsletter and follow us on Facebook and Twitter!
Last month, they formally requested that he and 129 other retired officers return to active service.
In addition to the insecurity since Kadhafi's overthrow, there have been growing fears in Libya and beyond about efforts by the Islamic State jihadist group to establish a stronghold in the country.
On Monday, two civilians were killed in Benghazi and 15 others wounded in a rocket attack on a residential quarter in the centre of the city, an army officer said.
- Daunting task -
The international community faces a daunting task to find a political solution to the lawless nation's political and military crisis.
Fajr Libya, a coalition of militias that seized Tripoli and which backs a rival government based in the capital, has rejected any political settlement that includes Haftar.
And Haftar has branded Fajr Libya -- which includes moderate militias considered the armed wing of the Libya branch of the Muslim Brotherhood -- as "terrorist" groups.
Haftar's convictions are not shared by many, with analysts saying that Fajr Libya has a role to play in UN-brokered talks just as much as the general.
Western countries also do not share Haftar's views and believe "he is putting moderate Islamists and extremist ones in the same bag," a Western diplomat said.
On Monday UN envoy Leon shuttled between the rival parliaments to persuade them to resume talks on a political solution to the crisis.
Lawmakers said Leon met representatives of the General National Congress, the parallel parliament backed by Fajr Libya, in Tripoli and with the legislature based in the eastern city of Tobruk.
After meeting with Leon, the Tobruk-based parliament voted to return to the talks, said lawmaker Abu Bakr Beira.
Last week the elected parliament cited Western pressure to include Islamists in a future government for its decision to suspend its participation in the UN-brokered talks.
The suspension came days after 40 people were killed in suicide car bombings in the eastern town of Al-Qoba claimed by the Islamic State jihadist group.