Former guerrilla leader and Maoist party chief Pushpa Kamal Dahal was elected the new prime minister of Nepal on Wednesday by a majority vote in the parliament.
He received support from 363 of the 573 parliamentarians who voted.
Dahal will become the 39th prime minister of Nepal, succeeding caretaker Prime Minister KP Sharma Oli, who stepped down last week ahead of a no-confidence vote in the parliament which he was expected to lose.
The Unified Maoist party chief was the lone candidate running for prime minister.
Dahal's victory became possible after the Nepali Congress, the biggest party in parliament, and a number of smaller parties threw their weight behind him.
"Dahal's main challenge as the prime minister will be to bring the various groups, especially, the Madhesh-based parties, who have been protesting against the new constitution, into consensus politics and to ensure an inclusive politics," outgoing deputy prime minister, Kamal Thapa told the media as he emerged from the parliament.
At least 50 people died in Nepal in anti-consitution protests in 2015. Critics claimed that the delineation of federal provinces disenfranchised the indigenous Madheshi people.
Dahal, also known as Prachanda, or the fierce one, led the Maoist guerrilla movement during the civil war from 1996 to 2006, in which more than 16,000 people died.
The Unified Maoist party joined mainstream politics in 2008. Dahal also served as prime minister from August 2008 to May 2009, but he was forced to step down after he attempted to sack then-army chief, Rookmangud Katawal.