Nepal's parliament has chose communist leader KP Sharma Oli as prime minister, tasked with unifying the quake-hit country after a new constitution triggered deadly protests, a border blockade and a nationwide fuel shortage. Oli, of the Communist Party of Nepal (Unified Marxist Leninist), defeated by 338 votes to 249 former premier Sushil Koirala, who stepped down from the top job as required by the constitution adopted on September 20. "I announce that respected member KP Sharma Oli has been elected to the post of Nepal's prime minister," Speaker Subash Chandra Nembang told parliament to loud cheers and applause as lawmakers raced to congratulate him. Oli is tasked with quelling protests over the new constitution and ending the blockade which has led to national fuel rationing, as well as pushing ahead with reconstruction after the earthquake in April killed thousands. He is known as a moderate within his party despite its communist leanings, and has vowed to work with other parties to develop the impoverished country. "My request is that all the parties must work together and move forward in consensus," Oli told lawmakers in an address before the vote. "There are groups that are dissatisfied with the constitution, we have to address their demands. Our country has been devastated by the earthquake. I will accelerate the reconstruction process." The current government is accused of stalling on rebuilding after the quake killed nearly 8,900 people and left more than half a million homeless. The constitution is aimed at bolstering the Himalayan country's transformation to a peaceful democracy after decades of political instability and a civil war. Read more: Nepal protesters cut off key India trading link with blockade at checkpoint, sparking fears of fuel shortages The main political parties were spurred into agreeing on the charter, after years of bickering, following the earthquake. But the constitution, the first to be drawn up by elected representatives, triggered a blockade by protesters at a vital border checkpoint, cutting off fuel supplies from India and sparking a nationwide shortage. Protesters from Nepal's southern plains are incensed about the charter, which will divide the country into several federal provinces. More than 40 people have been killed in clashes between police and the protesters representing ethnic minorities, who say the new federal structure will leave them under-represented in parliament. The historically marginalised groups include the Madhesi and Tharu minorities, who mainly inhabit the southern plains, along the border with India. The constitution is the final stage in a peace process that began when Maoist fighters laid down their arms in 2006 after a decade-long insurgency aimed at abolishing the monarchy and creating a more equal society. During his speech to parliament, Koirala, from the main Nepali Congress party, pledged to work with Oli if he lost the vote. But Ameet Dhakal, editor in chief of online news portal Sepopati, said Oli still faced an uphill battle in coming months. "There are enormous challenges for the new prime minister. The public will also have high expectations. He will have to resolve the crisis the country is facing," Dhakal said. Oli will also have to mend ties with giant influential neighbour India which is worried about instability on the border and has expressed concerns over the constitution. Oli has accused India of being behind the blockade that started on September 24 to protest against the charter.