India is known as the land of contradictions, and recent events do little to undermine that reputation. On the one hand, its Supreme Court is rapidly extending more rights to more groups. On the other, its ruling Hindu nationalist government is busy assaulting the longstanding rights even of incumbent groups. How things play out in this country of 1.35 billion people will have immense consequences for the entire region.

In September, India's Supreme Court scrapped a colonial-era law that, for two centuries, had held that gay sex was "against the order of nature." Thousands of people every year had been imprisoned under the law, and many more faced intimidation, harassment, and blackmail at the hands of corrupt law enforcement.

This doesn't mean that same-sex marriage is now legal in India. But for a place where arranged marriages are still the norm, decriminalizing homosexual acts is nothing short of revolutionary. The court even declared that gays and lesbians deserve the same rights and protections as everyone else and apologized for how the country had treated them.

In a great leap forward for gender equality, the judiciary recently rolled back a cuckoldry law, another gift of the Victorian-era British, giving a husband—but not a wife—the right to prosecute his spouse's lover and have him imprisoned for up to five years. The Supreme Court ruled that such a law reduced a wife to the status of "chattel," the property of her husband. This offended "constitutional morality," it said. It apparently did not offend the Hindu morality of Prime Minister Narendra Modi, whose Bharatiya Janata Party (BJP) strongly supported the law, even though it was enacted by "foreign invaders" against whom the BJP otherwise constantly froths.

Last year, the court also deemed sex by husbands with underage wives to be rape and overturned a sharia rule that allowed a Muslim man to divorce his wife by simply chanting "divorce" three times to her face, without having to pay adequate alimony. The Indian Constitution allows religions some flexibility to manage their civil affairs in accordance with their own strictures, but feminists and Muslim women had long—and rightly—railed against this practice and demanded an end to it.

None of this means that India is on a straightforward march toward ever-greater personal liberty and equal rights, unfortunately. The court can mint any rights it wants, but they're meaningless if authorities aren't willing to enforce them. And the current administration has made a mockery even of existing freedoms, to say nothing of new ones.

The liberty most vulnerable under Modi, an unabashed Hindu nationalist, is religious freedom. During his watch as chief minister of the state of Gujarat, Hindu goons, some with ties to his party, slaughtered more than a thousand Muslims in 2002. He cut his political teeth in the Rashtriya Swayamsevak Sangh (RSS), the Hindu version of the Hezbollah, a group that believes in taking aggressive measures to guard the country's 1 billion Hindus from their 200 million Christian and Muslim fellow citizens.

India's constitutional commitment to religious pluralism and secularism rankles the RSS because it has allowed these non-Hindu faiths to flourish. Modi sat back and watched as his minions conducted "reconversions" of Christians and Muslims in mass public ceremonies—on the grounds that they were duped by missionaries or forced by the Mughals (India's previous Muslim rulers) to abandon their true faith. Hindu vigilantes have gone around thrashing—and occasionally lynching—Muslims suspected of consuming beef, even though doing so is legal. One Harvard-educated minister in Modi's party actually garlanded and feted some such miscreants when they were released on bail.

In an unprecedented and shocking move, Modi appointed a Hindu monk who had been arrested several times for anti-Muslim incitement as the chief minister of India's most populous state. This man's first act upon assuming office was to shut down Muslim-owned slaughterhouses and double down on a crusade against "love jihad," an alleged conspiracy by Muslim men to seduce and marry Hindu women in order to convert them. Hindu hoodlums, without fear of repercussions, harass and assault mixed-religion couples. In one state in southern India, they even prevailed on a local court to annul a marriage and return a grown woman to her parents' home, overruling her protestations that she willingly converted to Islam because she loved her husband.

Nor is free speech safe under current leadership. Presaging President Donald Trump's attacks on "fake news," Modi and his supporters tried to discredit negative coverage as "paid news" during his campaign. Killings of scholars and journalists who question the ideology of Hindu nationalism have increased. My friend Gauri Lankesh, the publisher of a Bangalore-based tabloid that doggedly exposed public corruption and championed the rights of members of lower castes and Muslims, was assassinated at point-blank range in her driveway last year. The sinister Hindu outfits believed to have orchestrated the attack have yet to be shut down, but the administration isn't leaving any stones unturned in going after more people like Lankesh. In August, it cooperated with state authorities to launch multi-city raids on the homes and offices of human rights activists, journalists, lawyers, academics, and writers. The rap against them was that they were Naxals, members of a Maoist group, who had fomented violence at a dalit (lower caste) pride event in January. In reality, Hindu groups that have always despised the event delivered fiery speeches nearby, leading to violence.

The one freedom that many had hoped Modi would actually strengthen is economic freedom. After all, he ran on a platform of "minimum government, maximum governance," promising to dismantle the relics of the License Raj that had turned India into the economic basket case of the world. And indeed, the country's ranking on the World Bank's "ease of doing business" index went up 30 notches last year, making India 100th out of 190 countries. However, that progress has been more than negated by Modi's truly draconian demonetization stunt when, one fine day a few years ago, he issued an executive order obliterating 80 percent of India's currency and replacing it with new denominations.

Under the guise of dispensing welfare aid more efficiently, Modi has also created a kind of national ID system that civil libertarians are deeply worried will allow the state to track every financial transaction. And in a real step backward, he raised tariffs on labor-intensive goods such as toys, footwear, mobile phones, and TVs, reversing one of the main features of India's 1992 liberalization effort.

As a result, four years into his rule, a man who promised to turn India into an economic powerhouse in the mold of Hong Kong has barely matched the growth rate under his predecessor.

This is all terribly unfortunate for India, of course. But it is also bad news for the broader subcontinent. Successful polities inspire emulation. China's stunning growth and rising quality of life generated a great deal of interest in that country's model of development, prompting New York Times columnist Thomas Friedman to wax eloquent about the superiority of Beijing's benevolent one-party autocracy over America's messy democracy. Chinese economic growth has since stalled, and there's a growing sense that the Middle Kingdom's top-down industrial planning and aggressive social engineering have sown the seeds for a slowdown, if not a crash.

If India could hang on to its pluralist constitutional commitments while modernizing its economy and delivering better living standards, it could replace China as the main beacon of hope in the region, just as America's market liberalism became a model for Western Europe and Japan after World War II. The impact on India's neighbor, Pakistan, a quasi-theocracy that shares India's artistic, linguistic, and culinary traditions, would be particularly transformative. India's success would strengthen the hands of Pakistan's democratic reformers, who have been agitating for more freedom and openness. Middle Eastern countries like Saudi Arabia, Iraq, and Iran too would likely sit up and take notice—and would perhaps choose not to be left behind while India advances.

Everyone should hope and pray that India takes the enlightened path illuminated by its Supreme Court, rather than the barren and rocky road hewn by Modi and his illiberal, nationalist thugs.