Nepal's MPs have agreed to extend its parliament by up to a year, as reports suggest the prime minister agreed to resign to allow the deal to go through.
Maoist opponents had demanded Madhav Kumar Nepal's resignation as part of the deal to avert political crisis.
The parliament, elected in 2008, had been due to expire on Friday.
However, the extension was agreed at the 11th hour by the Maoists and the ruling Communist Party of Nepal and Nepali Congress parties.
Dinanath Sharma, a spokesman for the Maoist party - the largest in parliament - was reported as saying agreement had been reached to form a new national consensus government.
The parliament, or Constituent Assembly, which was elected after a decade of civil war, faced a Friday deadline to write a new constitution to replace the interim version.
However, there had been disagreement over the details of the new constitution, which would pave the way for fresh polls. The parliament's extension allows time for more negotiations.
The Maoists had said agreement was impossible without the resignation of the prime minister, in favour of a national unity government led by them.
Associated Press reported law minister Prem Bahadur Singh as saying Prime Minister Madhav Kumar Nepal would resign to make way for the new government.
The Maoists, who ended their decade-old rebellion in 2006 to join a peace process, had also demanded that their former fighters be integrated into the national army.
On Thursday, the President of Nepal had called party leaders to a meeting and told them to resolve their differences before parliament was dissolved or leave the country facing the prospect of presidential rule or even emergency rule.
Earlier this month, the Maoist party brought Nepal to a virtual standstill with a six-day strike in an attempt to force the government to resign.