Nepal's parliament has passed a new national constitution, weeks after political leaders reached a historic agreement to create a federal state following an earthquake that killed nearly 9000 people.
A loud cheer went up in the House as Speaker Subash Nembang announced on Wednesday (local time) that the long-delayed bill had been passed, with 507 of the 598 lawmakers voting in favour.
The marathon vote, which began on Sunday follows violent protests that have killed more than 40 people and shut down large swathes of the south.
The new charter will replace an interim constitution in place since the end of a decade-long civil war that led to the abolition of the Hindu monarchy.
It will divide the Himalayan nation of 28 million people into seven federal provinces, a move aimed at devolving power from the centre, but which critics say will not do enough to empower historically marginalised groups.
They include the Madhesi and Tharu ethnic minorities, who mainly inhabit the country's southern plains and who claim that the new internal borders will leave them underrepresented. Political leaders counter that no deal would have pleased everyone, and point to the urgency of ending the long stand-off over the constitution so the country can rebuild.
Work on a new constitution began in 2008, two years after the end of a civil war between state forces and Maoist guerrillas seeking to depose an autocratic king and end high levels of social inequality.
Nepal's three biggest political forces - the Nepali Congress, UML and Maoist parties - ended a deadlock on the issue in June after a 7.8-magnitude quake that killed nearly 8900 people and destroyed around half a million homes.
Last month the parties decided to demarcate the provinces in the constitution after warnings that leaving the borders undefined would store up future problems.
But the move unleashed a wave of violence that has killed more than 40 people.