Nepal elects KP Oli as PM amid political crisis
Parliament in Nepal has elected a new prime minister, Khadga Prasad Oli, who faces a series of daunting challenges.
Mr Oli received 338 votes of the 597-member chamber, the Speaker announced.
Mr Oli told cheering supporters in parliament that he saw his appointment as "an honour and a challenge".
The new leader will have to handle continuing protests over a new constitution, the rebuilding of the country after April's devastating earthquake and a fuel shortage.
Mr Oli, who was backed by a coalition of royalists, Maoists and centrists, is the first prime minister to be elected under the new constitution, defeating the previous prime minister, Sushil Koirala.
Some analysts say the conservative Mr Oli will be less able than Mr Koirala to reach out to the disaffected Madhesi community of southern Nepal who oppose the new constitution.
BBC South Asia editor Charles Haviland
Forty-five years ago, Khadga Prasad Sharma Oli was part of a short-lived, violent Communist uprising. That is distant history. Today he is a polarising figure within Nepal, which itself is deeply split on whether the new constitution is democratic enough.
Despite the radical name of his Unified Marxist-Leninist party, Mr Oli's detractors accuse him of wanting to perpetuate the status quo of high-caste dominance.
They say he has ignored the demands of the southern Madhesi and Tharu ethnic groups, who claim that the new constitution leaves them marginalised and under-represented.
But his supporters see virtue in his bluntness and have greeted his victory as a snub to India, which they accuse of unofficially blockading Nepal to try and force change to the constitution that is backed by Mr Oli.
The Nepali Times quotes him as saying on Saturday that he would "go all out" to address the genuine demands of Madhesis, Tharus and Nepal's many other excluded groups, as well as to "safeguard our nationality" and rebuild after the earthquakes.
Modern Nepal has always had a rapid turnover of prime ministers and it is difficult to predict how long or short the latest incumbent's tenure may be.
Madhesis have staged weeks of demonstrations which have hampered the flow of fuel and other goods from India.
The fuel shortages have become so acute that traffic has been kept off the roads.
Some in Nepal blame Delhi for blockading fuel supplies on the India-Nepal border because it supports Madhesi demands for changes to the constitution.
But India argues that insecurity caused by protests has meant that trucks carrying fuel and other essential goods cannot enter Nepal.
The new constitution was promulgated two weeks ago, but sparked protests in the plains, resulting in more than 40 deaths.
Thousands of people lost their lives and thousands more were injured in a 7.8-magnitude earthquake and aftershocks that hit Nepal earlier this year.