Nepalese politicians and regional giant India have hailed a landmark peace deal with Maoist rebels after 10 years of insurgency in the troubled kingdom.
Rebel leaders spent weeks negotiating with the government
The accord reached at midnight on Tuesday will see the rebels join a transitional government within a month.
Nepalese politicians said the deal was historic. India described it as a victory for the people of Nepal.
The BBC's Charles Haviland in Kathmandu says there are genuine hopes that the deal will end Nepal's civil conflict.
Under the accord, the rebels' weapons will be put under UN supervision.
Another major issue which has caused disagreement - the future of the monarchy - is to be resolved by a constituent assembly to be elected next year.
Government negotiator Ram Chandra Poudel said the deal had "opened the doors to build a new Nepal".
For the rebels, deputy commander Ananta said it was "a historic agreement". "With this agreement Nepal has entered into a new era," AFP news agency quoted him as saying.
People in Kathmandu hoped the accord would bring peace, but some expressed scepticism about the rebels' intentions.
In one suburb, hundreds of people stopped traffic and burned tyres shouting slogans against the rebels.
Nepalis have waited years for peace
They condemned the rebels for visiting homes demanding that Maoists coming to the city for a rally on Friday be given food and shelter.
The rebels deny exerting such pressures.
India's foreign minister Pranab Mukherjee said the deal was a "significant step in Nepal's democratic progress".
"We expect these decisions to place Nepal on the path of reconciliation, peace, stability and economic recovery," a statement said.
Nepal's transitional government will be formed at the beginning of December.
Rebel arms had been a sticking point in the talks
Before that, parliament will be expanded to take in 73 Maoist members, only two fewer than the biggest party, the Nepali Congress.
The Maoists entered into negotiations with the government after a popular uprising in April forced King Gyanendra to end his direct rule and appoint a multi-party government.
The decade-long conflict with the rebels has left about 13,000 people dead.
Prime Minister Girija Prasad Koirala and rebel leader Prachanda led the negotiating teams.
The future of the already disempowered monarchy will be determined at the first gathering of a constituent assembly due to be elected by next June.
The institution's fate will be decided by a simple majority.
The Maoists have been pressing for the monarchy's immediate suspension, but our correspondent says that will not happen.
Before the assembly election the rebels will be confined to seven camps.
They will keep the keys to their weapons but will be separated from them and the locks will be closely monitored by the UN. The Maoist army is due to enter the camps within 15 days. Parallel government structures set up by the rebels in the parts of the country they control will be disbanded.
A senior politician told the BBC that after that kidnappings and extortion - activities of which the Maoists are still widely accused - will be strictly treated as a criminal offence under the accord's provisions.
Everyone will be treated according to the law, he said.