Prime Minister Pushpa Kamal Dahal, who heads the Unified Communist Party of Nepal - Maoist (UCPN-M), made the announcement on live television on Monday, one day after his firing of the army chief was rejected by President Ram Baran Yadav - who officially leads the army - and which caused some of his key political allies to withdraw from the ruling coalition.
'The unconstitutional and undemocratic move by the president has pushed the country toward a serious political crisis,' Mr Dahal warned in his resignation speech.
'The president has no power to act alone without prior approval of the cabinet on such matters,' he went on, adding: 'It is a fatal attack on the infant democracy.'
The UCPN-M fought a 10-year 'people's war' against the Western-backed autocratic former regime before accepting a UN-brokered peace agreement and joining the political mainstream in 2006.
It subsequently won elections last year, leading to the establishment of a republican administration that swept away the country's centuries-old Hindu monarchy.
But many UCPN-M cadres who participated in the conflict remain restricted to UN-monitored barracks, despite the fact that the UN peace deal specified that the former guerillas should be freed and integrated into the national army.
Army chief General Rookmangud Katawal has stopped the deal from being implemented, sparring repeatedly with the government.
After Mr Dahal dismissed Gen Katawal on Sunday the main coalition partner of the UCPN-M the Communist Party of Nepal - United Marxist Leninist and other key coalition members withdrew from the government, accusing the PM of acting 'unilaterally.'
Mr Dahal said yesterday that he had decided to step down 'to create a conducive environment and save the peace process.'
Earlier in the day, thousands of Maoist supporters rallied in Kathmandu to show support for the government and denounce the president's action.
Elsewhere in the city, supporters of Mr Yadav's centre-right Congress Party blocked traffic with burning tyres, chanting slogans against the government and the Maoists.
There were no reports of any clashes between the two sides, but Home Ministry official Navin Ghimire said that security forces were preparing for unrest.
In neighbouring India the Communist Party of India - Marxist (CPI-M) urged Nepal's politicians to resolve their differences at the negotiating table.
CPI-M politburo member Sitaram Yechury said that the crisis 'should be resolved through democratic means and discussion in political process.
'Otherwise, whatever the people have achieved in Nepal through struggle will be derailed,' Mr Yechury warned, adding that there should be no external interference in Nepal.