Poverty and desperation were in full view. At traffic circles near my office, children with deformed limbs begged until long after dark. At construction sites, migrant laborers carried pans of dirt on their heads and slept on pieces of cardboard. In villages, people used the fields as their toilets, and some were so indebted to landlords that they had to rent out their children as servants.

AD

AD

When I think back on the contentious but secular mosaic of India I experienced between 1998 and 2005, I am stunned to see the ominous turn it has recently taken into religious intolerance.

At that time, Hinduism was dominant but not overbearing. With colorful rituals and beloved gods including an elephant and a monkey, it offered entertainment and escape, solace and hope for the masses. One of my most moving experiences was accompanying a modest Hindu family on a long train journey to the Ganges, where they waded in at dawn and baptized their shrieking baby boy in the frigid waters, certain that he was now blessed for life.

Promotion of the “Hindutva” ideology, an all-encompassing guide for life, often took the form of public services, carried out by disciplined youth cadres. I once watched a squad of these young, uniformed activists collect bloated corpses after a cyclone in Orissa state, while residents watched, grateful but horrified.

AD

AD

But religious tensions remained close to the surface, especially between Hindus and Muslims, whose differences had festered since the chaotic partition of India in 1947. Despite a population of 200 million and a few high-profile celebrities, such as film star Shah Rukh Khan, Muslims remained largely second-class citizens with little political clout.

My first encounter with such “communal” hostility occurred in my kitchen, where the Hindu manager angrily upbraided the Muslim watchman for drinking from his teacup. In public, far uglier clashes erupted periodically: In 1992, militant Hindu groups invaded and demolished the historic Babri Mosque; a decade later, Hindu-Muslim riots in Gujarat state left more than 1,000 dead.

In a dozen reporting trips over a decade to the Kashmir Valley, a bucolic alpine region on the Indian-controlled side of the Himalayan territory claimed by both India and Pakistan, I saw how the historic dispute had created a permanently open wound and a vicious cycle of protest and repression, often sparked by insurgent attacks.

The valley looked like Switzerland but felt like the Gaza Strip. I drove past apple orchards and meadows and visited quaint house boats that bobbed on Dal Lake, waiting for tourists who never came. But the news that brought me there was depressing and often deadly. The local Muslim populace was always waiting for the next funeral.

AD

AD

Yet somehow, something held India together — an intangible common cause among a billion people of many faiths, castes and languages.

I caught glimpses of this spirit during independence day celebrations and at peaceful demonstrations by striking teachers or railroad workers in a site in the capital reserved for protests. I saw it at election campaigns in crowded slums, and at village meetings where people spoke their minds and the statue of a man holding a book — the social reformer B.R. Ambedkar — stood nearby.

But I didn’t really understand it until I had also spent considerable time in Pakistan. Like India, it had a parliament, a judiciary, a vibrant press and frequent public rallies for various causes. But gradually, I realized that there were certain limits on all of this activity, mostly invisible and unspoken, but understood by everyone.

AD

AD

In practice, Pakistan’s governing system was rigged in favor of the rich, and the military wielded more power than civilian institutions. Millions of ordinary people had few rights or opportunities, making them vulnerable to the appeal of radical Islam. Rallies for Kashmiri independence were officially sanctioned, but anyone who truly challenged power was threatened or stopped.

What made Hindu-majority India more successful than Muslim-majority Pakistan was not religious dogma, it was political freedom. It was the glue of tolerance, the secular system that promised — if not always ensuring — that all Indians had a chance to air grievances and practice their faith. Corruption and caste discrimination persisted, but people felt that their voices and votes counted.

Today, though, India’s vaunted South Asian democracy is under unprecedented attack — not by foreign rivals, but by its own leaders.

The governing Bharatiya Janata Party is the same Hindu nationalist group that dominated power during the years I lived there. But its once-inclusive message — then tempered by the opposition Congress party — has been replaced by an aggressive agenda of Hindu hegemony. And the prime minister is now Narendra Modi, a religious hard-liner who was once accused of abetting the anti-Muslim rioters in Gujarat as the state’s chief minister.

Modi’s election in 2014 was largely based on his record as a champion of economic growth. But his reelection in May was stoked by a wave of patriotic and religious emotion after an especially deadly suicide bombing in Kashmir — which triggered an aerial skirmish between Indian and Pakistani warplanes — brought the nuclear-armed rivals dangerously close to war.

AD

AD

In August, Modi’s government abruptly revoked the semiautonomous rights for Kashmir that India’s constitution had granted in 1950, then flooded the region with troops, cut off the Internet and banned news coverage for months. Last month, after a semi-clandestine visit, the New Yorker journalist Dexter Filkins described the mood among Kashmiri Muslims as isolated, frightened and smoldering with anger.

Across the country, authorities have also used force, legal measures and harsh rhetoric to intimidate Muslims, branding them as potential terrorists. Police have stood by as mobs lynched Muslims for selling cows, which are venerated in Hinduism. Last month, a law was enacted that eases the path for illegal immigrants of six faiths to become Indian citizens — but specifically excludes Muslims.

Modi’s supporters praise such measures as necessary to quash the lingering menace of Islamic terrorism and restore India’s image as a haven for foreign tourists and investment. The country has never fully recovered from the 2008 four-day siege of Mumbai, the financial capital, by a Pakistan-based terrorist squad that left 165 people dead.

AD

AD

But there still may be reason to hope that India, long a political role model for the developing world, has not lost its democratic backbone.

In recent weeks, the new citizenship rules have provoked spontaneous and widening protests by a cross-section of Indians, including students at the country’s leading university, in defense of both Muslim minority rights and India’s tolerant democracy.

Last week, news reports showed a young woman, her arm in a cast and her head bandaged after a beating by Hindu nationalists, defiantly addressing a crowd in New Delhi. “Even if you beat us, we won’t step back,” she cried. “Long live the revolution.”