Prime Minister Girija Prasad Koirala and Maoist rebel leader Prachanda signed the agreement late Tuesday amid cheering by officials and foreign diplomats at a packed convention hall in Kathmandu.
The pact caps a peace process that began in April after political parties and rebels cooperated in a campaign to end authoritarian rule by the country's monarch.
Under the deal, the rebels are to end their "people's war," enter a temporary parliament and join an interim government by December 1st.
This interim administration will oversee elections scheduled to be held next year to choose a body that will draw up a new constitution for the country. Battle-hardened Maoist leaders, who plan to take part in those elections, are promising a peaceful transformation in a country that witnessed almost daily violence while the decade-long insurgency raged.
The editor of Samay magazine in Katmandu, Yuvraj Ghimire, says there is widespread optimism that Tuesday's pact will end the violence in the tiny Himalayan nation, but says its success hinges on its implementation.
"With effective monitoring and mechanisms to ensure that both sides stick to what they have said, what they have pledged, yes this triggers much of hope."
Even before the pact was signed, thousands of rebel fighters had begun heading toward camps where they will be confined until the elections.
Rebel weapons are being locked up under United Nations supervision although the insurgents will retain the key. In return much of the state army will also remain in barracks. Rebel leaders want their fighters to be eventually absorbed into the national army.
However, analysts warn the challenge to build a new Nepal will not be easy.
Allegations of human rights abuses continue to be leveled against the guerrillas. For example, rights groups Monday accused the rebels of continuing to forcibly recruit people into their camps, a charge they deny. But there is widespread hope that the tiny country may finally be on the road to peace.