Kathmandu, Nepal (CNN) -- Nepal's parliament on Sunday elected a leader of the former Maoist rebels as the new prime minister with a simple majority.
Baburam Bhattarai, 57, vice-chairman of the Unified Communist Party of Nepal (Maoist) will become the fourth prime minister since Nepal became a republic in 2008.
After his election Bhattarai said he would attempt to complete the peace process and the long-delayed new constitution.
Bhattarai received 340 votes in parliament, beating his rival Ram Chandra Poudel, 66, of the Nepali Congress, who received 235 votes.
Bhattarai, who has a degree in architecture and a doctorate in regional planning, was able to get the crucial support of the regional Madhesi parties from southern Nepal.
The 65 votes of the five parties of the Madhesi front were crucial for Bhattrai, whose party is the biggest in the 601-member parliament but lacks a majority.
Media reports say the Madhesi parties have been promised 12 ministerial posts in exchange for their support.
Bhattari is the second leader of the former rebels to become prime minister.
The Maoists became the biggest party in the 2008 elections and their chairman Pushpa Kamal Dahal was prime minister for nine months. He resigned in a dispute with the president, who reinstated an army chief Dahal had fired.
Earlier this month Jhalanath Khanal resigned as prime minister after he was unable to persuade the former Maoist rebels to demobilize and reintegrate their fighters in a deal that was agreeable to the other political parties.
The Maoists fought a ten-year insurgency from 1996 to 2006 in which about 16,000 people were killed.
According to the peace deal that ended the uprising, 19,602 United Nations-verified combatants should be integrated into the security forces, but the political parties are yet to agree on the number and the method.
Nepal also faces the challenge of preparing a republican constitution and political parties have twice extended the deadline to prepare the constitution.
The new deadline expires on Wednesday and political parties look likely to have to come to an agreement to extend the deadline a third time.