KATMANDU, Nepal — Nepal descended into a new crisis on Sunday after rival political parties in the Himalayan nation failed to reach an agreement on a new constitution before the national legislature’s term expired at midnight.

Prime Minister Baburam Bhattarai, speaking on national television, announced that the legislature, known as the Constituent Assembly, would be dissolved. He said he would remain in power and that his government would hold November elections for a new assembly. Rival political leaders quickly denounced the plan as a power grab.

“Political consensus is still needed to move ahead,” Mr. Bhattarai said in his address, just before midnight. Describing himself as “saddened” and “dejected,” the prime minister added: “Let us learn from mistakes and move ahead.”

The development on Sunday is yet another setback in Nepal’s long and often torturous transition from monarchy to democratic republic. The country suffered a decade-long guerrilla war by Maoist rebels that ended in 2006 when the Maoists agreed to put down their arms and join the democratic political process. The Constituent Assembly was elected to a two-year term in 2008, but that term was extended again and again after rival political parties failed to cut a deal on a new constitution.