Nepal's government and Maoist guerrillas agreed after 17 hours of talks on Tuesday (November 7) to put rebel arms under U.N. watch in a move to rescue a peace process aimed at ending a conflict that has killed thousands. The pact also paves the way for Maoists to join an interim government and parliament, seen as crucial steps on the Himalayan nation's cautious trek to a permanent peace after a decade of deadly civil conflict. Spokesmen from the the ruling seven-party alliance, told Reuters that the rebels would be kept in camps, and their arms would be monitored, while an equal amount of government arms would be locked away. The agreement was signed after two days of intense negotiations by Prime Minister Girija Prasad Koirala and Maoist chief Prachanda, who were supported by negotiators from both sides as well as leaders of the ruling alliance. The Maoists, who have proven themselves to be tough and adept negotiators as well as fighters, showed rare optimism, with senior Maoist leader Ananta calling the agreement "historic". A joint statement signed by Prachanda and Koirala said there would be 28 camps across the landlocked country to hold the Maoist fighters. The statement also said: "Both sides will set up an interim legislature including the Maoists and dissolve the existing parliament." The pact manages to get the Maoists -- who have fought for a decade to overthrow the monarchy -- to agree to allow the king to continue in an almost powerless form until a constituent assembly takes a final decision on his future after it is elected in 2007. Earlier, the Maoists had been demanding the abolition or suspension of the monarchy before the elections to the assembly. It was agreed that a decision on the future of the monarchy would be made at the first meeting of the constituent assembly. Analysts saw the pact as a chance to step up the peace momentum in the largely mountainous nation of 26 million people. The assembly will prepare a new constitution which was a key demand of the Maoists to end their revolt which has left more than 13,000 people dead and further impoverished one of the world's poorest countries, sandwiched between China and India. The rebels and the government announced a truce and began negotiations soon after King Gyanendra ceded absolute power following violent street protests in April that left at least 22 people dead and thousands wounded. But a dispute over disarming the rebel army had remained a sticking point because the Maoists had refused to lay down their guns before elections to the assembly. The Maoists have 35,000 fighters and a militia numbering around 100,000. It was not clear whether the agreement allowed for U.N. supervision of the militia. The Maoist-government statement said the rebels would dissolve their "people's government and people's courts" in the vast swathes of the countryside under guerrilla control.