Updated

Nepal's prime minister, a former guerrilla leader turned politician, resigned Monday after a power struggle with the president while his party vowed to launch mass protests and shut down parliament.

The resignation threw the impoverished Himalayan nation into turmoil as political leaders scrambled to adjust and security officials prepared for large demonstrations.

Prime Minister Pushpa Kamal Dahal made the announcement on television Monday afternoon, one day after his attempt to fire the army chief was blocked by President Ram Baran Yadav, who belongs to the main opposition party and officially leads the army.

In his resignation speech, Dahal accused Yadav of "a fatal attack on the infant democracy."

"The unconstitutional and undemocratic move by the president has pushed the country toward a serious political crisis," Dahal said. "The president has no power to act alone without prior approval of the Cabinet on such matters."

He said he stepped down "to create a conducive environment and save the peace process."

Nepal's Maoists fought a bloody 10-year war against the government before joining the political mainstream in 2006, and then winning the most votes during elections last year that helped bring an end to the Himalayan country's centuries-old monarchy.

The Maoists vowed Monday to launch demonstrations and shut down the government in protest of the president's actions.

"We have decided to begin mass protests ... and stall parliament until the president takes back his decision," the Maoists' party spokesman Nath Sharma said.

The party has deep support in rural Nepal and would likely be able to gather tens of thousands of people in the streets of Katmandu and other cities.

The former rebel leader — whose nom de guerre was "Prachanda," or "the fierce one" — remains as controversial as he is unpredictable.

Many see Dahal and the Maoists as revolutionary heroes who helped end the monarchy and bring democratic elections to Nepal.

Others, however, blame them for the chronic power outages, severe fuel shortages and rising food prices that have made life in this remote nation especially difficult in recent months.

Home Ministry official Navin Ghimire said security forces were preparing to deal with potential unrest.

"We are expecting trouble and are prepared to stop violence in the streets. Policemen are on high alert and will be mobilized throughout the capital," Ghimire said.

Authorities announced a ban on protests in key parts of Katmandu, including areas around the president's residence and office. Police in riot gear were deployed across the city.

Earlier Monday, thousands of Maoist supporters rallied in Katmandu to show support for the government and denounce the president's action. Elsewhere in the city, supporters of the main opposition, the Nepali Congress party, blocked traffic with burning tires and chanted slogans against the government and the Maoists.

There were no reports of any clashes between the two sides.

The dispute between Dahal and Yadav centered on the Maoists' former fighters who remain restricted to U.N.-monitored barracks under a peace accord. Dahal wanted the guerrillas freed and integrated into the military, as prescribed under a U.N.-brokered peace agreement. But army chief Rookmangud Katawal resisted those efforts and sparred repeatedly with the government.

Dahal, who took office in August, fired Katawal on Sunday, prompting a key political party to withdraw from the Maoist-led ruling coalition. Hours later, Yadav reversed the decision — provoking Dahal's resignation.

Dahal's Communist Party of Nepal (Maoist) has the most members in the national assembly but does not hold a majority, and needs the support of smaller parties to stay in control of the government.

The Maoist's main coalition partner, the Communist Party of Nepal (United Marxist Leninist), withdrew from the coalition Sunday and other parties were reportedly contemplating doing the same.