Though Pushpa Kamal Dahal - better known by his nom de guerre 'Prachanda' (the fierce one) - was the only contender for the top post, he had to go through the voting as the Constitution requires the Prime Minister to prove support of the majority lawmakers in the House.
The 61-year-old CPN-Maoist Centre chief, known for his anti-India stance, was elected Prime Minister with 363 votes in favour and 210 against him. Out of a total 595 members, 22 did not vote.
Speaker Onsari Gharti announced Prachanda's victory after the election.
Ahead of the election, Prachanda pledged to lead the nation toward economic development while moving ahead with the spirit of national consensus during his premiership.
Also Read
"I pledge that I will unite everyone in the country...I have a responsibility to solve this problem. I feel that I have been put forward as a candidate to work as a bridge between (communities)," he told the House.
He was prime minister from 2008 to 2009 before a disagreement with the military over his attempt to sack the army chief brought his period in office to an early end.
The Prime Minister's post had been left vacant since last month after CPN-UML chairman K P Sharma Oli tendered his resignation.
As per the agreement, the government-in-waiting would implement the Madhesi Front's demands that include acknowledging those killed during the Madhes agitation as martyrs and providing free treatment to the injured besides amending the Constitution to redraw provincial boundary, while the Madhesi parties would support the new government.
Prachanda is likely to announce a small cabinet
comprising members from Maoist party, Nepali Congress, CPN-United and Rastriya Prajatantra Party on Thursday after being declared as the Prime Minister.
Prachanda had led the Maoist party during the decade-long armed struggle from 1996 to 2006 and is credited with transforming the rebel movement into a political party after a 2006 peace deal.