The Maoist leader becomes the most powerful politician in the country
Members of Nepal's parliament have overwhelmingly elected the Maoist leader Prachanda as the country's new prime minister.
The 53-year-old won 80% of votes to defeat his only rival, the Congress Party candidate, Sher Bahadur Deuba.
Maoists won a surprise victory in April elections, and two other key parties supported Prachanda in the vote.
Last month, Nepal swore in a mainly ceremonial president, Ram Baran Yadav, after the monarchy was scrapped in May.
'Lenin or Napoleon'
It is only two years since Prachanda emerged from more than two decades underground as a militant communist leader.
"I am very happy and very emotional," he said as he left the constituent assembly after the vote, reported AFP news agency.
What the Maoists called their "people's war" had left 13,000 people dead, tens of thousands displaced and much of the country's infrastructure destroyed.
The BBC's Charles Haviland in Kathmandu says that now the former guerrilla will be the most powerful politician in the Himalayan country, after 464 lawmakers gave him their vote and only 113 rejected him.
The Maoists' deputy leader, Baburam Bhattarai, said: "Today is a day of pride and it will be written with golden letters in the history of the nation."
He predicted earlier that Prachanda would be a leader "for a new era", comparable to Lenin or Napoleon.
Friday's ballot ends months of political deadlock that had followed the sacking of the unpopular King Gyanendra and the abolition of the 240-year-old monarchy.
Our correspondent says that Prachanda's elevation had long seemed inevitable after his party scored its convincing win in April.
Prachanda was almost guaranteed victory because he had the support of three parties - his own, the Communist Party of Nepal (United Marxist-Leninist) and the MJF (Madheshi Janadhikar Forum).
The Maoists' Congress Party rivals accused them before the vote of plotting to set up a totalitarian communist regime, a suggestion they strongly denied.
A former agricultural science teacher-turned-revolutionary, Prachanda was originally named Pushpa Kamal Dahal, but he still uses his guerrilla nom de guerre.