NEW DELHI, NOV. 7 -- Eleven months after he took office promising to clean up government corruption and restore India's fraying democratic institutions, prime minister V.P. Singh fell from power tonight, undone by age-old problems of religion and caste and outflanked by rivals in his minority government.

Following a day-long, often boisterous debate in the lower house of Parliament, during which Singh defended his performance and accused Hindu militants of betraying his government, the prime minister was defeated overwhelmingly in a confidence vote, 346 to 142. Shortly after the tally was announced, Singh resigned as prime minister.

Singh's ouster appeared to clear the way for his rival Chandra Shekhar, a self-described socialist who engineered a split in the governing Janata Party earlier this week and then won public backing from opposition leader Rajiv Gandhi to form a new government.

But while Shekhar has positioned himself to become the country's next prime minister, the situation remains uncertain. India's head of state, President R. Venkataraman, has the option to block Shekhar's potentially unstable proposed government and call elections immediately. But most sitting politicians fear that elections now would exacerbate the religious and caste violence that has claimed hundreds of lives across India during the past two months.

Whatever comes next, Singh's defeat tonight, which had been widely expected, marked the end of an unusual and volatile period in Indian politics. During Singh's spirited campaign against then-prime minister Gandhi and his Congress Party last year and during his first months in office, many Indians abandoned their usual cynicism about politicians and invested their hopes in a leader who mustered an aura of integrity and high ideals.

But the problems Singh inherited when he took office last December intensified during his tenure. Inflation accelerated, government deficits and debt loads widened, secessionist movements in three states grew more violent, and the population became increasingly polarized along caste and religious lines.

Although Singh remains untainted by any charges of personal corruption, the promises he made about cleaning up government and rebuilding institutions went largely unfulfilled. Singh's supporters say the task was impossible in such a short time and with such unreliable partners in government. Still, many Indians have now come to see Singh as an ordinary party politician less interested in principles than in the furtherance of his career.

Months of perceived drift in Singh's government yielded to crisis in August after the prime minister announced that he would implement a controversial affirmative action plan for lower castes, a move that sparked riots across India's north.

Weeks later, as Hindu militants marched toward a disputed mosque in the northern town of Ayodhya, threatening to replace the mosque with a temple, Singh chose to confront the activists with force, igniting more riots and triggering a withdrawl of support from the Hindu revivalist Bharatiya Janata Party, the third largest in parliament. The BJP's withdrawal left Singh without a majority and he was unable to put together another coalition in time for today's vote.

Interrupted by shouts of "Let Lord Ram Prevail!" from Hindu activists, Singh devoted most of a 45-minute parliamentary speech this morning to the two emotional and intractable issues -- religion and caste -- that helped bring his government down.

He warned that if India's Hindu activists continued their march to power they would eventually destroy the country's democratic institutions and perhaps induce a military takeover, something India has avoided in 43 years of independence. He accused the BJP of holding itself above the law and the constitution and of betraying promises it made when Singh's minority government was formed a year ago.

"Governments come and go," Singh said. "The question is, what kind of country do we want?"

Singh also ridiculed Shekhar's proposed breakaway government that would be backed by the Congress Party, saying such a government would be even weaker than his own.

Shekhar, who has been maneuvering for more than a year to become prime minister, followed with a sharply worded attack on Singh's integrity and performance in office. "Our country is on the verge of a storm. It's going in the wrong direction," he said. "We may not improve it, but we will try to save it."