But the king may still be removed if he creates "serious hurdles", a joint statement from the government and Maoists said.
"Nepal will be a Federal Democratic Republic nation ... and the decision will be implemented after the first meeting of the constituent assembly," it said.
"But if the king creates serious hurdles to the constituent assembly elections, a two-third majority of the [interim] parliament can remove the monarchy even before the polls."
New political framework
Government leaders had met Prachanda, head of the Maoist rebels, to break the deadlock that had damaged the 2006 pact ending the conflict between the rebels and government.
Next year's elections will create a constituent assembly to rewrite Nepal's constitution and develop a new political framework for the country.
All parties agreed that the assembly would have 240 members directly elected by the voters and 335 who will get seats under a proportional representation system, with parties getting seats in proportion to the number of votes they receive.
The Maoists began their armed insurgency in 1996. The fighting between communist fighters and government troops has left at least 13,000 people dead in 10 years.
The Maoists formed links with the main political parties last year, joining pro-democracy street protests that forced King Gyanendra to give up the direct rule he had assumed in 2005 after sacking the government.