NEW DELHI, NOV. 10 -- One morning 11 months ago, Chandra Shekhar, a veteran socialist and ward politician who has seen most of what Indian politics has to offer, sat in a parliamentary building here wearing an expression of embarrassment and anger.

Moments before, V.P. Singh had been elected leader of the centrist Janata Party, guaranteeing he would become India's seventh prime minister. Shekhar had maneuvered for days to win the job. But at the last minute, an ally of Shekhar stood in the crowded meeting and nominated Singh instead -- a prearranged switch apparently designed to heap maximum embarrassment on Shekhar.

Afterward, Shekhar refused to rise from his chair. Reporters crowded around, indelicately probing for a quote. But Shekhar's face was set like stone, his eyes fixed ahead. "Ask them," he said of his political rivals with audible menace.

This morning, at President Ramaswamy Venkataraman's official residence, Shekhar exacted his revenge. After working steadily to engineer a split in the Janata Party and to force Singh's ouster from government, Shekhar, 63, was sworn in as prime minister. After taking the oath, Shekhar cheered.

Chandra Shekhar's triumph may matter little to the world beyond India's borders, since his policies are likely to resemble closely those of his predecessor and his weak minority government is not expected to last very long. Indeed, Shekhar's ascent does not impress many Indians, who increasingly express despair about the petty opportunism of their political leaders.

But Shekhar's ascent does shed light on the state of India's democracy 43 years after independence, illuminating both its decay and its resilience.

Alone among the world's 30 poorest nations, and despite innumerable ethnic, religious and social problems, India has continuously practiced Western-style parliamentary democracy for more than four decades, holding generally fair elections and peacefully handing off the baton of power even in the midst of its worst crises -- such as the religious and caste riots that have claimed more than 300 lives during the last two months.

Unlike his counterparts in dozens of developing countries, when Shekhar lost out to Singh last December, he did not order a squad of goons into the streets to smash store windows, or cozy up to disgruntled generals passed over for promotion, or retreat into the jungle to organize an insurgency. Instead, he negotiated in political back rooms with legitimately elected members of parliament until he organized a majority on the floor of the lower house.

But while India's democratic institutions remain strong enough to force every contender for power to play by parliamentary rules, they also are weakening enough to create manifold opportunities for corruption, to provoke widespread cynicism in the electorate -- and to raise questions among some politicians about whether India will still be functioning as a secular democracy at the turn of the century.

In a farewell speech Wednesday occasioned by Shekhar's victory, outgoing premier Singh issued a stark warning about what he called the anti-democratic goals of India's growing force of Hindu revivalists -- and the nominally secular politicians willing to exploit the Hindu militants' strength to achieve their own political goals.

Singh said his move to block Hindu militants who wanted to erect a temple on the site of an existing mosque in the northern town of Ayodhya last month -- which sparked violence and gave Shekhar the opening he had been awaiting -- was made necessary because the militants refused to abide by a court order delaying construction of their temple. The Hindu militants rejected the court's authority, saying their religious faith could not be governed by civil law.

"When it is said that religious faith is above the constitution and above law . . . that is the basis of a theocratic state," Singh said in his speech.

The government's attempt to block desecration of the Ayodhya mosque partially failed, a senior paramilitary officer in New Delhi acknowledged, because Hindu soldiers and police officers at the scene were overwhelmed by the religious chanting of the Hindu demonstrators and could not bring themselves to oppose the militants.

In his speech, Singh noted that India's armed forces have avoided political ambitions or religious polarization, but he predicted that if the campaign of militant Hindu nationalism continues, young soldiers eventually will be influenced. "What will ultimately happen is that people will be deprived of their democratic rights," Singh said.

Shekhar and other opponents of the former prime minister dismiss such warnings as sour grapes from a defeated politician. They say there always has been and always will be a strong consensus at the center of Indian politics in favor of secular democracy.

Hindu activists tend to support Singh's pessimistic view, however. Hari Kansal, joint secretary of the Vishwa Hindu Parishad, a militant religious group that organized the march on Ayodhya, summed up his views on the future of Hinduism and democracy in India in an interview last week: "If something is a question of faith, nobody should question that faith.".

Shekhar has promised to cool tempers and assuage religious and caste hatreds unleashed during his rival's brief tenure. But in dozens of conversations in villages and cities during the past two weeks, many Indian voters expressed skepticism about Shekhar's ability to make a courageous stand against Hindu activists or to defend the country's democratic institutions.

Having now achieved India's top office, Shekhar stresses his commitment to ideals such as secularism and democracy. But a month ago, when the prime ministership seemed a distant goal, Shekhar was asked by Sunday magazine whether he felt regret over some of his more opportunistic political maneuvers. "It will be very wrong of me if I say I have never regretted any of my decisions," he said. "But sometimes, I feel it is all part of the game."

With Hindu militants vowing to ignore civil law and government in their campaign, Indians may have to decide soon whether the political "game" Shekhar referred to will continue to be governed by democratic rules.