Nepal's rebel leader, Prachanda, has said the Maoists will use politics not violence to "meet the aspirations of the people's longing for peace".
Rebel leaders spent weeks negotiating with the government
Nepalese politicians along with giant neighbour India and the US and UK have welcomed the peace accord between the government and the rebels.
The deal will see the Maoists join an interim government within a month.
The BBC's Charles Haviland in Kathmandu says there are genuine hopes the deal will end the decade-long conflict.
"Our experiences have shown we could not achieve our goals through armed revolution so we have chosen the path of negotiation and formed an alliance with the political parties," Prachanda told a news conference in Kathmandu just hours after the accord was reached.
He said the rebels would respect human rights and democracy and the rule of law "when a new constitution and a new government is formed".
In a BBC interview, he promised that the parallel state that the Maoists run in much of Nepal would be dissolved once they entered government.
The agreement reached at midnight on Tuesday has been welcomed by Nepalese politicians who said the deal was historic.
Prime Minister Girija Prasad Koirala said: "I believe this is a new revolutionary solution to the country's problems."
India described the agreement as a victory for the people of Nepal. The United States welcomed the deal but warned its success depended on how it was implemented.
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.
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.
Under the accord, the rebels' weapons will be put under UN supervision.
People of Nepal have waited for years for peace
The thorny issue of 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.
Nepal's transitional government will be formed at the beginning of December.
Before that, parliament will be expanded to take in 73 Maoist members, only two fewer than the biggest party, the Nepali Congress.
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 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.