The Nepalese parliament today elected Madhav Kumar Nepal as the country's prime minister - ending nearly three weeks of political crisis, according to dpa. Nepal, 56, was elected unopposed by the constituent assembly on Saturday evening after a boycott by the Maoists, who walked out in anger over the collapse of their government. "Madhav Kumar Nepal has been elected unopposed as the prime minister of Nepal," constituent assembly chairman Subash Nembang announced. "I also wish his government all the success for the task of drafting the new constitution." Speaking briefly to reporters after his election, Nepal said he would try to bring the Maoists into consensus with other political parties and end the transitional period in the country as soon as possible. He will succeed Pushpa Kamal Dahal, a former Maoist guerilla leader, who resigned after a power struggle with President Ram Baran Yadav, following the sacking of the army chief Rukmangad Katuwal on May 4. The president reinstated the army chief just hours after the government action - leading to protests from the Maoists. Nepal, with the backing of over 350 members from 22 political parties in the 601-member assembly was the sole candidate, as the Maoist decided not to field any candidate or take part in the election. Nepal, a member of the moderate Communist Party of Nepal-Unified Marxist Leninist (CPN-UML), lost last year's election for the constituent assembly. He was however, inducted in the assembly on the insistence of the Maoists who said his presence was necessary to draft the country's new constitution. He is expected to form a new government over the next few days.