Consider the view from New Delhi at the beginning of the previous century's final decade. In 1991 India was a nation of 843 million people and five million telephone lines. A billion dollars separated it from bankruptcy. The Indian map had rarely looked so vulnerable to another cartographic revision. If the flames of separatism in Punjab seemed to be simmering, the secessionist strife in Kashmir was just peaking. Hindu nationalists, a fringe force in Indian politics a mere decade ago, now occupied the bulk of opposition seats in parliament, poised to banish the secularism that had been the foundational basis of Indian nationalism.

India was holding its 10th general election against this backdrop, and it was turning out to be the most violent in the country's history. Eight hundred people had already been killed in political clashes when, on May 21, a suicide bomber assassinated Rajiv Gandhi - unfurling a fresh cycle of bloodshed and renewing questions about India's ability to survive as a nation.

Beyond its own imperilled borders, India's guardian and lodestar, the USSR, was lurching towards disintegration. Moscow shielded India from international criticism for its repression in Kashmir, maintained a crucial $6 billion trade relationship, and supplied defence equipment in exchange for goods. For a generation of Indians, the Soviet Union's demise upended the certitudes of a lifetime. Visiting India at this time, Ved Mehta felt "a sense of dread about the economic, political and religious direction of the country which I don't remember encountering in any of my other visits over the past 25 years".

The barren rhetoric of economic self-reliance and political nonalignment could no longer mask India's deep decay. Here, after all, was a colossus of a country that forced its enterprising citizens to wait three years to import a computer. How then did India retreat from the threshold of collapse to reform itself and emerge, by the start of the 21st century, wealthier and more powerful than at any point in its history?

It is now de rigueur to credit prime minister Manmohan Singh, who was then finance minister, with India's phenomenal transformation. But in a country where economic isolation was an inviolable ideological axiom, reorienting India to flourish in the new world was a distinctly political challenge. Singh was then, and is now, a competent but essentially voiceless bureaucrat, not a politician. He merits as much credit for rehabilitating India in the 1990s as he deserves blame for its failures today.

The man who led India's transformation was an unlikely pragmatist. He was 70 and had undergone triple-bypass surgery when he assumed office. A career politician, he had no political constituency of his own. There was hardly a voice that did not lament his elevation to the premiership. And yet if Jawaharlal Nehru "discovered" India, it can reasonably be said that PV Narasimha Rao reinvented it.

•••

On the night of May 21, 1991, Rao was packing up his library in his New Delhi home in preparation for retirement. After spending two decades in the capital, Rao was eager to revive the scholarly life that had been curtailed by his entry into politics.

Born in 1921 in the Muslim-ruled princely state of Hyderabad, Rao was adopted as a child by an affluent Brahmin family. In the Nizam's destitute kingdom the law, literature and activism were domains of the secure, and Rao blazed through each of them. Even before he was 30, Rao acquired something of a reputation as a freedom fighter, barrister and scholar. He trained as a guerrilla to fight the Nizam, smuggled bombs and weapons into Hyderabad, founded and edited a literary journal, translated a Marathi novel into Telugu and a Telugu novel into Hindi, and published a clutch of short stories.

After Hyderabad was incorporated into the newly independent India and then into the newly created state of Andhra Pradesh, Rao was elected to the provincial legislature. He stumbled through a number of ministries before Indira Gandhi appointed him the state's chief minister. Rao forced through an ambitious land reform act, compelling feudal landlords, many of them his colleagues in the legislature, to distribute their holdings to landless peasants. In turn, he gave up most of his own inherited estate.

Still, Rao's resolve proved to be the cause of his downfall. Indira Gandhi, keen to pacify regional bosses, dismissed Rao's government in early 1973 and summoned him to New Delhi. He was over 50, but sufficiently pragmatic to grasp the secret of survival in Congress: don't ever display autonomous drive or initiative. From then on his career was a study in fealty to Gandhi. He supported her during the Emergency, when she suspended democracy and assumed dictatorial powers. She appreciated Rao's erudition, and rewarded him for his loyalty by offering him important portfolios in her government. His colleagues described Rao as a "sphinx-like enigma", a man who was fluent in 12 languages but, they complained, spoke his mind in none.

When Gandhi's Sikh bodyguards killed her in 1984, Rao transferred his loyalty to her son, Rajiv. But Rao was a spent force in Indian politics by 1991. Retired from parliament, he was marginally involved in the general election campaign that year, issuing the occasional statement ridiculing the Hindu-nationalist BJP's foreign policy pronouncements. No one listened to him.

That changed on the night of May 21, when an aide arrived with news from Tamil Nadu: at 10.20pm, Rajiv Gandhi, the leader of the Congress Party, was killed in an explosion while campaigning in the southern town of Sriperumbudur. With the unifying figurehead dead, Congress was a beehive of competing factions.

Every potential successor had an equally powerful adversary within the party. By a process of elimination Rao emerged as the consensus candidate to "carry forward" Rajiv's legacy. No one knew that Rao had recently published an article under a pseudonym denouncing Rajiv as a brash, insecure and self-destructive politician. But now Rao appeared innocuous, showed no ideological leanings, had no antagonists or friends, and did not arouse visceral reactions.

Powerful Congress politicians such as Sharad Pawar, ND Tiwari and Arjun Singh opted for Rao as an interim leader, fully intending to displace him after the general elections. But their differences only amplified when Congress emerged as the single-largest bloc in parliament the next month.

Rao wasted no time in establishing his authority: none of his erstwhile backers was given a ministerial portfolio of his choice and their supporters within parliament were kept out of the government. But even before his party could fully fathom Rao's unanticipated ruthlessness, he unleashed the unthinkable upon them. On July 1, Rao devalued the rupee. Within 48 hours, he devalued it still further.

He then went on national television to deliver what seems in retrospect like the most consequential speech since Nehru's address to the nation at India's birth in 1947. Rao did not aspire to grandiloquence, but the momentousness was not lost on those who heard him. "Desperate maladies call for drastic remedies," Rao warned Indians as he revealed his austerity programme. "This is the beginning. A further set of far-reaching changes and reforms is on the way ... we believe the nation, as well as the government, must learn to live within its means ... there is much fat in government expenditure. This can, and will, be cut."

He announced a plan that would substantially deregulate industry and delicense the private sector, pull down the barriers to foreign investment and provide tax concessions to private corporations, slash subsidies to farmers and curb labour activism. With blinding celerity, Rao was dismantling Nehruvian India.

Almost immediately, Rao's party rose up against him. Dozens of senior Congress members beseeched Sonia, Rajiv's widow, to take over Congress and rescue the country. The Herald, the party's newspaper, said that Rao's programme was designed to give "the middle-class Indian crispier cornflakes or fizzier aerated drinks". "That," the paper affirmed, "could never have been the vision of the founding fathers of our nation."

Rao's response was both bold and brazen. "Reversing the policy options is not available to this government anymore," he said frankly. "It is a one-way street and on all sides I have red lights." He then floated the idea of introducing organisational elections to the Congress Party. Asia's oldest political party had adopted a system of patronage when Indira Gandhi took charge. Appointments to party posts were doled out in New Delhi, and some of the most powerful leaders had no political mandate at all.

Rao, of course, was the most patent beneficiary of this system. But his proposal jolted his opponents who, after showing some early signs of rebellion, became more submissive. As if to bolster his position still further, Rao began cultivating the Hindu-nationalist BJP and fostered a friendship with its president, LK Advani.

A deeply chauvinistic Hindu refugee from the Pakistani province of Sindh, Advani was the most poisonous political figure in India at the time. In 1990, he led a countrywide rally to the ancient town of Ayodhya, where Hindus had laid siege to the 460-year-old Babri Mosque, claiming that it was built on the site of the mythical Hindu deity Rama's birth. Babri Mosque - the mosque of Babar, the founder of the Mogul Empire - thus crystallised into a symbol of Islamic oppression in the imagination of a resurgent Hindu community unshackled from Nehruvian convictions. The Babri Mosque became the focal point of the contest between secular and Hindu India. Rao extracted assurances from Advani that the mosque would not be harmed. In 1992 Advani led another rally to Ayodhya. This time, his followers demolished the mosque. And in a savage announcement of their "awakening", they butchered Muslim children and women in Ayodhya.

Rao immediately dismissed all four BJP-run governments in India, banned religious organisations, and threw Advani in prison. In a highly charged speech in parliament, he accused the BJP leader of betraying his trust. But members of Rao's own party now questioned his commitment to secularism.

•••

If many Indians were suspicious of Rao, foreigners overwhelmingly cheered him on. In Germany, Chancellor Helmut Kohl considered him less flamboyant than Rajiv Gandhi. "Perhaps the country needs more substance than style at this moment," he said. In America, the Christian Science Monitor congratulated him for "negating Nehru". In Britain, the Financial Times nominated him alongside Deng Xiaoping as "Man of the Year".

Rao himself appeared to be growing impatient with the unchanging obsessions of developing countries. When Zimbabwe and Malaysia delivered blistering attacks against the West at a summit, Rao asked the gathering: "Have you come across any conference where all the speeches are identical?" But he took his riskiest step yet by agreeing to meet the influential Jewish leader Isi Liebler in 1991.

Having voted against the creation of Israel at the UN in 1947, India withheld from establishing full diplomatic relations with Tel Aviv. Indeed, Israel's presence in India was limited to a tiny consulate in Mumbai, regarded by its diplomats as "the loneliest place in the world". India had no presence in Israel at all.

A historic vote to overturn the "Zionism equals racism" resolution was about to come up at the UN, and Liebler appealed to Rao to vote for it. He passionately argued for full diplomatic relations and complained that India had treated Israel as a "pariah". Rao assured Liebler that India never equated Zionism with racism. "We sometimes have to go along with things we are not 100 per cent in agreement with," Rao said. Liebler pressed him further, but Rao refused to commit. Yet when the resolution came up at the UN, India voted for it.

As talk of upgrading relations with Israel picked up momentum, Rao rushed to mollify India's Arab allies by inviting Yasser Arafat on a state visit to India in January 1992. The Palestinian leader was lavishly feted in New Delhi and by the end of the trip, Arafat approved Rao's plans to engage with Israel. Forty-three years of estrangement between India and Israel ended within two months.

Rao aggressively renewed India's lapsed relations with East Asian states, particularly with Singapore and Japan, with his "look east" policy. He travelled to Singapore and Seoul, Tokyo and Beijing, Kuala Lumpur and Bangkok, Tehran, Paris, Bonn and London. The only two major capitals that he did not visit were Moscow and Washington.

He ignored the former and, in 1994, made a groundbreaking trip to the latter - the first visit to the US by an Indian head of government in nine years. Bill Clinton's decision to sell F-16 fighter jets to Pakistan, combined with his administration's ceaseless criticism of India over its conduct in Kashmir, provoked a furore in India. Rao was under severe pressure to cancel the trip. There was intense lobbying, too, by nationalists to assert India's independence by carrying out a nuclear test. Rao knew that a test would lead to international sanctions and derail his reforms.

He determined to focus on trade during his first visit to the US. The Americans received him as something of a revolutionary. The Wall Street Journal praised him effusively for repudiating Nehru's "xenophobia" and embracing the markets. Morgan Stanley released a report stating that Rao's reforms were moving India toward "tigerisation". A group of major US businesses - including AT&T, GE, Ford and Coca-Cola - formed an autonomous lobbying group called the India Interest Group to promote India in Washington. Bowing to the markets, Clinton assured Rao that the US would no longer air its concerns about human rights in public, even if proliferation would remain an issue. By the end of 1995, India was attracting more foreign investment than it had managed in the previous four decades combined and two-way trade with the US had jumped to $7.3 billion.

"Foreign exchange coffers are filled as never before. Industry is booming as never before. Most of all, there is a palpable hope in the air," wrote one commentator. India now seemed like a different country. The middle class became more conspicuously consumptive than ever before. The credit card industry, which had a negligible presence in India before the reforms began, expanded into a $64 million business by 1996. The creed of this emerging "New India" was captured in the advertising slogans pasted on the billboards of major cities: "I. Me. Mine." "It's My Life." "Keep Up Or Be Left Out." The editor of India Today assured his readers that the "stigma" attached to wealth and ostentation in Nehruvian India was now outdated. But even as New India erupted in self-congratulation, it had to contend with the odd spectacle of seeing its architect run from his own accomplishments. As elections approached, a different India was clamouring for attention. Its realities were captured in a report released by Oxfam. Rural poverty in the reform years had grown from 33 to 48 per cent. Ninety-seven per cent of Indians in the countryside lived without access to sanitation. The parvenus perusing India Today could now exhibit their wealth without remorse, but most Indians felt crushed by the food prices, which rose by 60 per cent by 1996 alone. A disproportionate burden of the deficit reduction programme was borne by the poor. Since the government's tax concessions to the corporate sector made it impossible to increase revenues, it resorted to cutting public investment and social expenditure. At the same time more than a dozen of the country's top-50 private corporations - the cathedrals of New India - succeeded in avoiding taxes altogether.

As the economic liberalisation picked up pace between 1993 and 1995, Rao's party was thrown from power in traditional Congress strongholds throughout the country. In Rao's home state of Andhra Pradesh, it was reduced to 26 seats in the 294-seat legislature. Campaigning for re-election in 1996, Rao omitted all references to the economic reforms. The New York Times reported that he "feared provoking a backlash among poor Indians who have had to pay more for rice, sugar and fuel". Party candidates pleaded with Rao to stay away from their constituencies.

In the elections that followed, Congress suffered the worst defeat in its history. The Hindu nationalists stitched together a coalition, but Rao extracted his pound of flesh for the Ayodhya "betrayal" when he crushed Advani's dream of becoming prime minister by having him implicated in a corruption scandal. Two years later, Sonia Gandhi took over Congress and Rao was expelled from the party. His name was gradually erased from the party's history.

Rao spent the remainder of his years fighting corruption charges dating back to his time in office. As the 1990s came to a close, he became the first Indian prime minister to be convicted in a criminal court when he was found guilty of bribing opposition MPs to vote for his government. The conviction was later overturned on appeal. Still, it was an ignominious twilight. When he died, in 2004, his old colleagues in Congress refused to hold his funeral in New Delhi. His body was flown back to Hyderabad, where it lay in state in an empty hall.

•••

Nehru's India rested on four pillars: democracy, secularism, socialism and non-alignment in foreign affairs. Propelled by accident into India's highest political office, Rao eroded his nation's adherence to each one of them. His economic reforms were implemented by subverting democracy: critical reforms were made as executive decisions, prices were hiked when parliament went into recess and parliamentary opposition was overcome by exploiting legal technicalities. The Princeton academic Atul Kohli calls this a "two track democracy", where "common people are only needed at the time of elections, and then it is best that they all go home, forget politics, and let the 'rational' elite quietly run a pro-business show".

The Indian state's commitment to secularism also collapsed. It did not occur when Advani's Hindu mobs tore down the Babri Mosque on December 6, 1992. It happened with the state's failure to rebuild it. Indian Muslims are now urged to "get over" the mosque's destruction by the very people who seek recognition of their victimhood for "crimes" committed by Muslim "invaders" centuries ago.

A decade after the mosque's demolition, 1,000 Muslims were murdered in Gujarat in a state-sponsored pogrom. A decade on from that, Gujarat's chief minister, Narendra Modi, is the BJP's putative candidate for prime minister. Industrialists and movie stars trip over themselves to pronounce him the saviour of India. India's secularism is now a self-fulfilling myth, a promissory note that is loudly advertised but never permitted to be cashed. This is the legacy of Rao's failure to crush Hindu nationalism when it went to war against the Indian state in Ayodhya.

Rao was the first Indian leader who made foreign industrialists feel as if they were in the presence of a "corporate chief executive", not a politician - an early incarnation of praise which, sanctified by decades of repetition at Davos, has become the highest aspiration of most third-world "modernisers". But in applauding his revolution for supposedly correcting the failures of Nehru, the cheerleaders of New India have ignored the seeds of discontent planted by Rao. They have now matured. Across India's most impoverished regions, armed Maoists are waging guerrilla warfare against the state.

India's progress does not manifest itself in these troubled villages in the form of clean water or electricity or schools or sanitation. It appears in the shape of heavy machinery sent to extract prized minerals from tribal lands and the arms of paramilitary forces used to displace villagers. The poet Dom Moraes once wrote that India had "the most brutally stupid middle class in the world". Illustrating his claim, an overwhelming majority of media commentators uncritically cheer on the state, giving rise to a false idea of symmetry of power between the Maoists and the government. This is also Rao's legacy.

Rao led India out of one of the one the worst crises in its history, opened it up to the world, dismantled corrosive old orthodoxies, and pursued unthinkable new friendships. In doing so, he corrupted India's democracy and crippled its commitment to secularism. He left behind an India that is wealthier (but more unequal), confident (but less empathetic), and integrated into the world economy (but closed to its poorer citizens).

A man without any known ideological leanings, Rao had no difficulty believing that the lofty ideals of India's founders had simply run their course. But in the end even he was dismayed by the avarice and apathy of his own creation. In one of his last public speeches, he bewailed his successors' rush to sell public assets and reminded Indians that "trickle-down economics - the practice of cutting taxes for the rich, hoping it would benefit the poor - does not work."

He is now reviled by his own party, forgotten by the world and neglected by India. He remains the only departed prime minister to be denied a memorial in the country's capital. But today's India, for better or for ill, is Rao's India.

Kapil Komireddi is an Indian freelance writer. His work has appeared in the Boston Globe, Foreign Policy and the Los Angeles Times.